Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I am using the execute() method of HttpClient class to execute the HttpClientRequest and it works just fine.
But, I need the response code and response headers as they are required at times while working with the Google Data Protocol, especially with Documents List API.
How can I send a request using this module and get response code, response header and of course, response body at the same time?
Comments
Comment #1
voxpelli CreditAttribution: voxpelli commentedThe response code should be possible to find in the response object as "responseCode", the response message as "responseMessage", the headers as "headers" and the body as "body".
So doing a $client->get() should return an object with those properties so that you can check eg. $obj->responseCode to get the responseCode.
Comment #2
vaidik CreditAttribution: vaidik commentedSo with the help provided by voxpelli, I am doing this to achieve what I wanted to:
Thanks a lot for the help.