Questions tagged [zend-http-client]

Zend_Http_Client provides an easy interface for preforming Hyper-Text Transfer Protocol (HTTP) requests.

Zend_Http_Client provides an easy interface for preforming Hyper-Text Transfer Protocol (HTTP) requests. Zend_Http_Client supports most simple features expected from an HTTP client, as well as some more complex features such as HTTP authentication and file uploads. Successful requests (and most unsuccessful ones too) return a Zend_Http_Response object, which provides access to the response's headers and body.

62 questions
2
votes
1 answer

How replace file_get_contents with Zend_Http_Client ?(differnce in encoding etc..)

How replace file_get_contents with Zend_Http_Client ?(differnce in encoding etc..) code that should be replaced: $url='http://google.com';$timeout=60; $t = stream_context_create(array('http' => array('timeout' => $timeout))); $content =…
Ben
  • 25,389
  • 34
  • 109
  • 165
2
votes
3 answers

Getting Zend_Http Final URL

Making a simple request like: $client = new Zend_Http_Client('http://example.org'); $response = $client->request(); How can I get the final URL after the redirects? I have not seen a way in the documentation or the API docs unless I'm missing…
clips404
  • 33
  • 4
2
votes
1 answer

Sending a custom header with ZEND_HTTP_CLIENT

How can I send a custom header with the ZEND_HTTP_CLIENT. I am trying to send a variable key with a certain value, that I will check later for authenticity I've tried this $client = new Zend_Http_Client('http://localhost/v3/files/'); …
Vrashabh Irde
  • 14,129
  • 6
  • 51
  • 103
2
votes
3 answers

Unable to enable crypto on TCP connection api.mysite.com on Zend

I was creating a module application for Zend Framework 2. When I try to send a post request to my server with the necessary details, I get the error "Unable to enable crypto on TCP connection api.mysite.com". Earlier, I was getting the error…
user2740957
  • 171
  • 2
  • 15
2
votes
1 answer

Retrieve SSL Certificate with Zend Http Request and Response

I'm trying to connect to a third party API and I'm using the Zend 1.7.0 framework to access it. To authenticate, I have to first check an SSL certificate returned from a URL. This is what I'm doing in my code. $client = new…
JR.
  • 45
  • 1
  • 4
2
votes
0 answers

handling Zend_Http_Client Invalid URI supplied

i have an error during run this simple code. $hc = new Zend_Http_Client(); $hc->setUri('http://fa.wikipedia.org/wiki/ایران'); // Invalid URI supplied how can i handle the valid uri for zend http client?
1
vote
2 answers

ZendFramework - How to upload multiple files using the zend_http_client?

How to upload multiple files with ->setFileUpload()? For example i have this:
user285594
1
vote
1 answer

Zend Http Client

While setting GET parameters for Zend_Http_Client, you can use array with name-value pairs or pass name and value on each call to the function setParameterGet. While making a call to LinkedIn API, I have a situation where there are multiple GET…
Prashant
  • 7,340
  • 2
  • 25
  • 24
1
vote
1 answer

How to use Zend_Http to send and receive files

My client code is: $Client = new Zend_Http_Client( $url, array( 'maxredirects' => 1, 'timeout' => 5, 'useragent' => 'LMS_LiveAccess' …
Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
1
vote
0 answers

How to handle chunked/streamed response data using Zend_Http_Client?

I have a Zend_Http_Client which connects to a HTTP-Server that streams its data in chunks. I want to handle each received chunk directly as it is received. None of the existing Http_Adapter in the Zend Framework seem to not provide a…
favo
  • 5,426
  • 9
  • 42
  • 61
1
vote
1 answer

How do I get the http response/server code from each request in Zend Framework?

Using the Zend Framework Http client, how do I get the http response/server code from each request? I am getting the body just fine, but the response code would be nice too.
Tom
  • 91
  • 6
1
vote
1 answer

how to set "REFERER" in Zend_Http_Client?

Hi I am using Zend_Http_Client with adapter Zend_Http_Client_Adapter_Curl , I tried setting REFERER using $client = new Zend_Http_Client('http://www.example.com',array('adapter'=>'Zend_Http_Client_Adapter_Curl'); …
Mr Coder
  • 8,169
  • 5
  • 45
  • 74
1
vote
3 answers

Zend_Http_Client not storing cookies

I am using the following code to access a page protected by username/password login. //Fetch homepage $client = new Zend_Http_Client(); $client->setCookieJar(); $client->setUri('https://www.yourloungelearning.co.uk/crew_trainer/login.php'); …
gsteinert
  • 1,324
  • 2
  • 10
  • 13
1
vote
1 answer

How get a valid JSON output from the response in Zend Framework 3?

I'm writing a client for an API... use Zend\Http\Client; use Zend\Http\Request; use Zend\Json\Json; ... $request = new Request(); $request->getHeaders()->addHeaders([ 'Accept-Charset' => 'UTF-8', 'Accept' => 'application/hal+json', …
automatix
  • 14,018
  • 26
  • 105
  • 230
1
vote
2 answers

How to check Zend_Http_Client is available on server

Sorry I'm not familiar with php and I have to send something via Zend_Http_Client. How I can check that feature is available on server, because at the moment I've only got error 500.