Vinelab / http

A smart, simple and fault-tolerant HTTP client for sending and receiving JSON and XML
57 stars 30 forks source link

send Content-Length in the headers? #11

Closed mansouralex closed 7 years ago

mansouralex commented 9 years ago

How to send Content-Length in the headers when you send request, also how to decide the Content-Type?

Mulkave commented 9 years ago

you may send the headers as mentioned in the docs:

$response = HttpClient::get([
    'url' => 'http://some.where.url',
    'headers' => ['Content-Length: 12345', 'Content-Type: application/json']
]);