![]() ![]() (Zend_Http_Client::AUTH_BASIC) is supported. Similar to the ones accepted by the Zend_Http_Client::setAuth() method. Proxy_auth sets the proxy authentication type, if your proxy server requires authentication. If your proxy does not require authentication, you can leave Providing these willĪdd a ‘Proxy-Authentication’ header to the request. Proxy_user and proxy_pass are only required if your proxy server requires you to authenticate. ![]() proxy_port defaults to ‘8080’ - if your proxy listens on a different port you Proxy_host should always be set - if it is not set, the client will fall back to a direct connection using Zend_Http_Client configuration parameters Parameter Array of options $options = array ( 'socket' => array ( // Bind local socket side to a specific interface 'bindto' => '10.1.2.3:50505' ), 'ssl' => array ( // Verify server side certificate, // do not accept invalid or self-signed SSL certificates 'verify_peer' => true, 'allow_self_signed' => false, // Capture the peer's certificate 'capture_peer_cert' => true ) ) // Create an adapter object and attach it to the HTTP client $adapter = new Zend_Http_Client_Adapter_Socket () $client = new Zend_Http_Client () $client -> setAdapter ( $adapter ) // Method 1: pass the options array to setStreamContext() $adapter -> setStreamContext ( $options ) // Method 2: create a stream context and pass it to setStreamContext() $context = stream_context_create ( $options ) $adapter -> setStreamContext ( $context ) // Method 3: get the default stream context and set the options on it $context = $adapter -> getStreamContext () stream_context_set_option ( $context, $options ) // Now, perform the request $response = $client -> request () // If everything went well, you can now access the context again $opts = stream_context_get_options ( $adapter -> getStreamContext ()) echo $opts ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |