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

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -