Make WordPress Core


Ignore:
Timestamp:
02/03/2023 01:33:18 PM (16 months ago)
Author:
audrasjb
Message:

HTTP API: Fix request header inconsistencies.

This changeset improves the consistency in capitalization of fetching and outputting of request headers. It also updates occurrences found in some docblocks.

Props johnjamesjacoby, costdev, audrasjb, petitphp, mhkuu, SergeyBiryukov.
Fixes #54225.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/post/wpAfterInsertPost.php

    r52010 r55210  
    172172
    173173        $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/posts/%d', $post_id ) );
    174         $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
     174        $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
    175175        $request->set_body_params( array( 'title' => 'new title' ) );
    176176        rest_get_server()->dispatch( $request );
     
    189189
    190190        $request = new WP_REST_Request( 'POST', sprintf( '/wp/v2/posts' ) );
    191         $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
     191        $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
    192192        $request->set_body_params(
    193193            array(
     
    212212
    213213        $request = new WP_REST_Request( 'PUT', sprintf( '/wp/v2/media/%d', $attachment_id ) );
    214         $request->add_header( 'content-type', 'application/x-www-form-urlencoded' );
     214        $request->add_header( 'Content-Type', 'application/x-www-form-urlencoded' );
    215215        $request->set_body_params( array( 'title' => 'new attachment title' ) );
    216216        rest_get_server()->dispatch( $request );
Note: See TracChangeset for help on using the changeset viewer.