Forum Discussion

gaganchawla's avatar
gaganchawla
Occasional Contributor
12 years ago

Http Header issue while using with JSON

Hi,
I have a Rest webservice which retrieves the data from the server.
Get method.
Content-Type : text/Html

I have changed the content type via adding HTTP header as Content-Type : text/json.

It shows that in the request, but it always returns me back the old text/Html type.

Can anybody help, what can be done here.

Thanks,
G

4 Replies

  • GiscardN's avatar
    GiscardN
    Frequent Contributor
    Hi,

    What you receive will depend on what content type your service is set to return.
    Do you get JSON in your text/Html response?

    Regards,

    Giscard
    SmartBear Support
  • gaganchawla's avatar
    gaganchawla
    Occasional Contributor
    Yes, I am getting the text/Html as response, but I want to override it.

    via updating the request header, content-type: application/json in SoapUI Pro, but the response is still the same text/html.

    Cheers,
    G
  • GiscardN's avatar
    GiscardN
    Frequent Contributor
    Hi,

    Overriding the request header will not cause your response to be returned necessarily as content-type: application/json.
    Can you verify that your web service is set to return json responses?
    If possible, please share your the raw response that you are receiving.

    Thanks,

    Giscard
    SmartBear Support