Particle.ParticleCloud.MakePostRequestWithoutAuthAsync C# (CSharp) Méthode

MakePostRequestWithoutAuthAsync() public méthode

Makes the post request without authentication asynchronous to the particle cloud.
public MakePostRequestWithoutAuthAsync ( String method ) : Task
method String The method.
Résultat Task
		public virtual async Task<RequestResponse> MakePostRequestWithoutAuthAsync(String method, params KeyValuePair<String, String>[] arguments)
		{
			if (String.IsNullOrWhiteSpace(method))
			{
				throw new ArgumentNullException(nameof(method));
			}

			client.DefaultRequestHeaders.Clear();

			HttpResponseMessage response;
			if (arguments != null)
			{
				response = await client.PostAsync(method, new FormUrlEncodedContent(arguments));
			}
			else
			{
				response = await client.PostAsync(method, null);
			}
			var str = await response.Content.ReadAsStringAsync();
			RequestResponse rr = new RequestResponse();
			rr.StatusCode = response.StatusCode;
			rr.Response = await Task.Run(() => JToken.Parse(str));

			return rr;
		}