0

What is the issue?

We need to extract X-CardConnect-SessionKey from the response header of Card-Connect API. We are using v2/connect API of CardConnect through PHP-CURL method.

What we have done to extract the header?

We are using below methods of PHP to get the headers from the response

get_headers | getallheaders

Passing the below parameters in the CURL request:

CURLOPT_FOLLOWLOCATION => 1,

CURLOPT_RETURNTRANSFER => 1,

CURLOPT_VERBOSE => 1,

CURLOPT_HEADER => 1,

CURLINFO_HEADER_OUT => 1,

CURLOPT_NOBODY => 1,

Our Observations.

When we call the same API from PostMan we are able to see X-CardConnect-SessionKey in the response header, but when we dump full header using the above methods not getting that same key highlighted in below screen-shot.

enter image description here

Biraj Zalavadia
  • 28,348
  • 10
  • 61
  • 77
  • Possible duplicate of https://stackoverflow.com/questions/9183178/can-php-curl-retrieve-response-headers-and-body-in-a-single-request – 04FS Oct 22 '19 at 12:48
  • (`getallheaders` won’t help you here, that is for getting the _request_ headers of the current request that triggered your PHP script.) – 04FS Oct 22 '19 at 12:49

0 Answers0