remove_header ( $key )

Removes an HTTP header from the cURL request.

Access

public

Parameters

Parameter

Type

Required

Description

$key

string

Required

The custom HTTP header to set.

Returns

Type

Description

$this

A reference to the current instance.

Examples

Add a custom header to the request, and then remove it (without firing it).

$http = new RequestCore('http://github.com/skyzyx/requestcore/raw/master/_tests/test_request.txt');
$http->prep_request();

$http->add_header('x-requestcore-header', 'value');
$http->remove_header('x-requestcore-header');

var_dump($http->request_headers);
Result:
array(2) {
  ["Expect"]=>
  string(12) "100-continue"
  ["Connection"]=>
  string(5) "close"
}

Source

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback