Quantcast
Channel: Web Duos » POST
Viewing all articles
Browse latest Browse all 3

Use Multiple Headers in a PHP

$
0
0

With PHP, you can send multiple HTTP headers with file_get_contents() . you can also send information such as HTTP_ACCEPT, HTTP_ACCEPT_LANGUAGE, and HTTP_CONNECTION with file_get_contents(). In this post, I have write a complete example code to set multiple headers; an Authorization header and a Content-Type header using PHP and make POST request using file_get_contents(). <?php $options = ["http" => [ "method" => "POST", "header" => ["Authorization: token " . $access_token, "Content-Type: application/json"], "content" => $data ]]; $context = stream_context_create($options); ?> Now […]

The post Use Multiple Headers in a PHP appeared first on Web Duos.


Viewing all articles
Browse latest Browse all 3

Trending Articles