Join 34,000+ subscribers and receive articles from our blog about software quality, testing, QA and security.

HTTP_Request2 Issues with APIs


I am trying to replace curl calls for php bindings with HTTP_Request2, but getting below issue with simple get method

Code Example :

$request = new HTTP_Request2(‘’, HTTP_Request2::METHOD_GET);

‘Expect’ => ‘’,
‘Content-Type’ => ‘application/json’,
‘Authorization’ => ‘Basic USER:PASSWORD’,

$res = $request->send();

Response Error :

body:protected] => {“error”:“Content-Type header missing (use Content-Type: application/json)”}