Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#33711 closed enhancement (fixed)

Introduce HTTP API response cookie functions

Reported by: johnbillion's profile johnbillion Owned by: wonderboymusic's profile wonderboymusic
Milestone: 4.4 Priority: normal
Severity: normal Version:
Component: HTTP API Keywords: has-patch
Focuses: Cc:

Description

We have several HTTP API helper functions for retrieving the response code, body, and headers, but none for the cookies or an individual cookie.

Let's introduce:

  • array wp_remote_retrieve_cookies( $response )
  • WP_Http_Cookie wp_remote_retrieve_cookie( $response, $cookie )
  • string wp_remote_retrieve_cookie_value( $response, $cookie )

Attachments (1)

33711.patch (3.1 KB) - added by johnbillion 9 years ago.

Download all attachments as: .zip

Change History (4)

@johnbillion
9 years ago

#1 @johnbillion
9 years ago

  • Keywords has-patch added

#2 @johnbillion
9 years ago

  • Milestone changed from Future Release to 4.4

#3 @wonderboymusic
9 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 34369:

HTTP: Add some new Cookie helper functions:

  • wp_remote_retrieve_cookies( $response )
  • wp_remote_retrieve_cookie( $response, $name )
  • wp_remote_retrieve_cookie_value( $response, $name )

Adds unit tests.

Props johnbillion.
Fixes #33711.

Note: See TracTickets for help on using tickets.