Accept-encoding Gzip

Accept-encoding Gzip

Can we set the accept-encoding? For soap webservices this is critical.
Joao Sousa wrote:
Can we set the accept-encoding? For soap webservices this is critical.
Hi João!

You can add a response header by using the AddHeader action from HTTPRequestHandler. Go to references, find the extension HTTPRequestHandler and pick the AddHeader action.

Add this action to your preparation screen, set the accept-encoding that fit your need, and you should be ready to go.

Let us know if this is the solution that your looking for.



I didn't want to add it to the preparion screen since I'm running the webservice call in a AJAX request (because it takes a while and I don't want to lock the main UI). It says the addHeader doesn't work with AJAX requests. 

Thanks anyway

Hi João

I believe Kelter might have got what you wanted wrongly: from your description you want to add the accept-encoding header to the request to a web-reference (rather than a header in a web-service response). Is this correct?

If that is the case I don't know of an option to do that using the Agile Platform to consume the web-reference. How critical is that? Is that such a huge dataset being transfered that the difference between compressed and not is that big?


Yes, I want to add to the request not the response. We are talking about 20 MB -> 800 KB which is substancial when you're talking about mobile scenarios. I'm testing with a bandwith of about 100 KB/s, for a payload of 1 MB so the user must wait about 10 seconds for the response. With a client that supports gzip the connection is much faster (i've implemented proxies for iOS and Android, and supporting gzip is painless).

And yes, 100 Kb/s is bad, but that's what I've got to work with. 

PS: With SOAP responses the compreession if very high because of all the tags that keep repeating themselves.