getURL & postURL cannot pass "Authorization" key in header map.
This exception has been thoroughly tested.
Problem :
The header map variable (passed to getURL & postURL functions) will not permit the inclusion of an "Authorization" key/value pair.
DS function to HTTP resource :
- map test.passingHeader()
- {
- url = "http://webpdi.com/info.php";
- header = {
- "Authorization" : "Basic dXNlcm5hbWU6cGFzc3dvcmQ=",
- "header1" : "passed header1!",
- "header2" : "passed header2!",
- "_Authorization" : "So I can pass \"_Authorization\" but not Authorization?"
- };
-
- response = getUrl(url, header,false);
- info header;
-
-
- /*RESPONSE LOOKS LIKE THIS
-
- {responseCode=200, responseText=
- Array (
- [Host] => webpdi.com
- [Connection] => Keep-Alive, TE
- [TE] => trailers, deflate, gzip, compress
- [User-Agent] => RPT-HTTPClient/0.3-3E
- [_Authorization] => So I can pass "_Authorization" but not Authorization?
- [header2] => passed header2!
- [header1] => passed header1!
- [Accept-Encoding] => deflate, gzip, x-gzip, compress, x-compress
- )
- }
-
- */
-
- return response;
- }
HTTP resource code (yeah, that's all) :
- <?php
- print_r(apache_request_headers());
- ?>
Hurl.it test showing the correct response.