Forum Discussion

tslosar's avatar
tslosar
Contributor
10 years ago

Modifying REST response HTTP headers

How do I modify the built-in HTTP headers for a mocked REST service?

Also I noticed some differences between 5.0.0 and 5.1.1. (I only have the 14 day trial of 5.1.1 - and I can't successfully deploy my mocked REST service...)
I found a link in a post from 2012 however it is dead...

I need to activate the "Connection" header with value Keep-Alive. When I add it as a custom header (I have added 3 others) it is simply ignored.
I need to activate the "content-length" header.
I need to change the value of the "Content-Type" header. Default is what is sent in the request - however the service I am mocking always (always) returns "application/xml;charset=UTF-8".

I notice in 5.1.1 "Transfer-Encoding" is missing however "Content-Length" is there... ??

Appreciate any help.

Kind regards,

Tony

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    You mean to say you can't see content length in the request? I can see it in the raw message when added 'Content Length' in the request's header property(did not put value, so empty shown).
  • Thank you for your response.

    I need the content-length header activated in the RESPONSE. Do I have to add the header and some java code to calculate the length?