0

In my integration tests, ContentType is null when I make Get requests using ServiceStack's JsonServiceClient. However all the Post requests have a ContentType. Is it excluded on purpose? ie. Do I need a content type for http get requests?

Is there a way I can set the ContentType using this client?

Community
  • 1
  • 1
JustinS
  • 123
  • 1
  • 7

1 Answers1

1

There is no Content-Type for GET Requests since it doesn't have a Request body.

The Content-Type on the Request Header specifies what format the Request Body is in, likewise when on the Response Body specifies what format the Response Body is in.

You may instead be after the Accept HTTP Request Header which tells the server the preferred Content Types it would like the Response in.

mythz
  • 141,670
  • 29
  • 246
  • 390