Make WordPress Core

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#37168 closed defect (bug) (invalid)

wp_remote_post headers being set to lowercase

Reported by: dsifford's profile dsifford Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6
Component: HTTP API Keywords:
Focuses: Cc:

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)

#1 @dsifford
9 years ago

  • Resolution set to invalid
  • Status changed from new to closed

Disregard -- I think it's my server that's normalizing the headers.

#2 @swissspidy
9 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.