php - Sending a custom header with ZEND_HTTP_CLIENT -
how can send custom header zend_http_client
. trying send variable key
value, check later authenticity
i've tried this
$client = new zend_http_client('http://localhost/v3/files/'); $client->setheaders('content-type','multipart/form-data'); $client->setheaders('key','xxxxxxxxxxxxxxxxxx'); $client->setparameterpost('document_id', $id); $client->setparameterpost('type_id', $doctype['type']); $client->setparameterpost('file', $form->file); $response = $client->request(zend_http_client::post);
and this
$client = new zend_http_client('http://localhost/v3/files/'); $client->setheaders(array( 'content-type','multipart/form-data', 'key','xxxxxxxxxxxxxxxxxx')); $client->setparameterpost('document_id', $id); $client->setparameterpost('type_id', $doctype['type']); $client->setparameterpost('file', $form->file); $response = $client->request(zend_http_client::post);
but doesnt seem work. says key
not valid type. want send custom header (similar happens when set headers postman client). possible?
try add config param this:
$client = new zend_http_client('http://localhost/v3/files/', array('strict' => false));
Comments
Post a Comment