Forum Discussion

jzyling's avatar
jzyling
Occasional Contributor
12 years ago

How to set content type to be application/json?

Hi,

I am trying to use POST method to post some values to the server, the Media Type that I can choose from only have three options: application/xml, text/xml, multipart/form-data. May I ask how to set the application/json content type?

Thanks.

2 Replies

  • Hi,

    You have 2 options:
    - if you use the REST Resources then you can go to that method and define an representation for "request", like in the below screenshot, this will make the application/json displayed in the drop down for that method:

    - if you use the HTTP request then all u need to do is to open the request and just type the content they you want eg application/json, this will be available only for this request if you have more like this then you need to repeat this step:


    Hope this will help you.
  • jzyling's avatar
    jzyling
    Occasional Contributor
    ccdssv1 wrote:
    Hi,

    You have 2 options:
    - if you use the REST Resources then you can go to that method and define an representation for "request", like in the below screenshot, this will make the application/json displayed in the drop down for that method:

    - if you use the HTTP request then all u need to do is to open the request and just type the content they you want eg application/json, this will be available only for this request if you have more like this then you need to repeat this step:


    Hope this will help you.


    It helps a lot. Thank you.