#37168 closed defect (bug) (invalid)
wp_remote_post headers being set to lowercase
| Reported by: | dsifford | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | HTTP API | Version: | 4.6 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
Not sure if this is a known feature (it's not in the documentation anywhere that I could find), but if I set an all-caps header key in the args that I give to wp_remote_post, the header is converted to all lowercase.
So, for example:
<?php $response = wp_remote_post("https://my-api.com/endpoint", array( 'headers' => array( 'MY_API_KEY' => 'value', ), 'body' => array( 'foo' => 'bar', ), ));
results in...
my_api_key: 'value'
(along with the other default headers)
Any ideas?
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Disregard -- I think it's my server that's normalizing the headers.