login about faq

Using the (c++) http.PostJson() method, Chilkat uses (uncommon) "application/jsonrequest" as content-type. This seems to cause problems with some server frameworks. Shouldn't it be "application/json" according to RFC 4627?

Using http.AddQuickHeader("Content-Type", "application/json") fixes this problem, but it's just a workaround.

asked Aug 15 '13 at 04:28

Marco's gravatar image


Use the PostJson2 method. See the online reference documentation.

CkHttpResponse *PostJson2(const char *url, const char *contentType, const char *jsonText);

The same as PostJson,except it allows for the content type to be explicitly provided. 
The PostJson method automatically uses "application/jsonrequest". If the application needs 
for the content type to be "application/json", or some other content type, then PostJson2 

answered Aug 15 '13 at 08:33

chilkat's gravatar image

chilkat ♦♦

edited Aug 15 '13 at 08:34

Yes, thanx, can be done via JsonPost2. My documentation was too old.

But I think that content type "application/json" should be used by default in PostJson and other unusual content types (like jsonrequest) with PostJson2. Just a thought.


answered Aug 16 '13 at 02:58

Marco's gravatar image


Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: Aug 15 '13 at 04:28

Seen: 1,226 times

Last updated: Aug 16 '13 at 02:58

powered by OSQA