fuelopf.blogg.se

Delphi serializeobject
Delphi serializeobject













delphi serializeobject

  • Create a StringContent object and add it the request’s body without forgetting to set the encoding and content type.
  • Serialize the content to send into a JSON string.
  • SendAsync(request, HttpCompletionOption.ResponseHeadersRead, cancellationToken) Using (var stringContent = new StringContent(json, Encoding.UTF8, "application/json")) Var json = JsonConvert.SerializeObject(content) Using (var request = new HttpRequestMessage(HttpMethod.Post, Url)) The following code is little more evolved version of what we can see in most projects : private static async Task PostBasicAsync(object content, CancellationToken cancellationToken)

    delphi serializeobject

    This time we will go a bit further and implement POST calls. We now know how to create efficient HTTP Get calls with HttpClient and JSON.NET.

    delphi serializeobject

    Before going further I highly recommend that you read the previous post explaining how to create efficient GET calls since it serves as this post starting point.















    Delphi serializeobject