Answers for "json content type c#"

C#
0

content type application/json c#

var url = new Uri("");  // url to make post request to
var json = "";  // json to post

// create string content with MediaTypeHeaderValue
var stringContent = new StringContent(json)
{
  Headers =
  {
    ContentType = new MediaTypeHeaderValue("application/json")
   }
};

// make http request
var response = await client.PostAsync(url, stringContent);
Posted by: Guest on July-27-2021

Code answers related to "json content type c#"

C# Answers by Framework

Browse Popular Code Answers by Language