Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

How to retrieve only body of response

Reconnect Oct 24, 2017 11:35AM UTC

Hello team

I am making http requests to a site and how to get only body of the response.

here is the code :-

req = self._helpers.buildHttpMessage(headers, body)
print self._helpers.bytesToString(req)
resp = self.callbacks.makeHttpRequest("127.0.0.1", 1330, True, req)
print self._helpers.bytesToString(resp)

I have tried to get body by resp.getResponse() but it didnt work,


Paul Johnston Oct 24, 2017 12:38PM UTC Support Center agent

Hi Reconnect,

First use IExtensionHelpers.analyseResponse to get and IResponseInfo object. This has a getBodyOffset() method, and you can use that with Python string splicing.

Please let us know if you need any further assistance.


Post Your public answer

Your name
Your email address
Answer