Answers for "content type application/json"

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(partialSnackerJson)
{
  Headers =
  {
    ContentType = new MediaTypeHeaderValue("application/json")
   }
};

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

what is the correct json content type

For JSON text:

application/json

The MIME media type for JSON text is application/json. 
The default encoding is UTF-8. (Source: RFC 4627).

For JSONP (runnable javascript) with callback:

application/javascript
Posted by: Guest on June-18-2020

Code answers related to "content type application/json"

C# Answers by Framework

Browse Popular Code Answers by Language