|
|
@@ -206,8 +206,10 @@ $response = $client->request();
|
|
|
</example>
|
|
|
|
|
|
The request() method takes one optional parameter - the request method.
|
|
|
- This can be either GET, POST, PUT, HEAD, DELETE, TRACE, OPTIONS or
|
|
|
- CONNECT as defined by the <acronym>HTTP</acronym> protocol
|
|
|
+ This can be either <property>GET</property>, <property>POST</property>,
|
|
|
+ <property>PUT</property>, <property>HEAD</property>, <property>DELETE</property>,
|
|
|
+ <property>TRACE</property>, <property>OPTIONS</property> or <property>CONNECT</property>
|
|
|
+ as defined by the <acronym>HTTP</acronym> protocol
|
|
|
|
|
|
<footnote>
|
|
|
<para>
|
|
|
@@ -220,9 +222,10 @@ $response = $client->request();
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- If no method is specified, the method set by the last setMethod()
|
|
|
- call is used. If setMethod() was never called, the default request
|
|
|
- method is GET (see the above example).
|
|
|
+ If no method is specified, the method set by the last
|
|
|
+ <methodname>setMethod()</methodname> call is used. If
|
|
|
+ <methodname>setMethod()</methodname> was never called, the default request
|
|
|
+ method is <constant>GET</constant> (see the above example).
|
|
|
|
|
|
<example id="zend.http.client.basic-requests.example-2">
|
|
|
<title>Using Request Methods Other Than GET</title>
|
|
|
@@ -243,14 +246,14 @@ $response = $client->request();
|
|
|
<title>Adding GET and POST parameters </title>
|
|
|
|
|
|
<para>
|
|
|
- Adding GET parameters to an <acronym>HTTP</acronym> request is quite simple, and can
|
|
|
- be done either by specifying them as part of the URL, or by using
|
|
|
+ Adding <constant>GET</constant> parameters to an <acronym>HTTP</acronym> request is
|
|
|
+ quite simple, and can be done either by specifying them as part of the URL, or by using
|
|
|
the setParameterGet() method.
|
|
|
- This method takes the GET parameter's name as its first parameter,
|
|
|
- and the GET parameter's value as its second parameter.
|
|
|
+ This method takes the <constant>GET</constant> parameter's name as its first parameter,
|
|
|
+ and the <constant>GET</constant> parameter's value as its second parameter.
|
|
|
For convenience, the setParameterGet() method can also accept a
|
|
|
- single associative array of name => value GET variables - which may
|
|
|
- be more comfortable when several GET parameters need to be set.
|
|
|
+ single associative array of name => value <constant>GET</constant> variables - which may
|
|
|
+ be more comfortable when several <constant>GET</constant> parameters need to be set.
|
|
|
|
|
|
<example id="zend.http.client.parameters.example-1">
|
|
|
<title>Setting GET Parameters</title>
|
|
|
@@ -273,9 +276,9 @@ $client->setParameterGet(array(
|
|
|
</para>
|
|
|
|
|
|
<para>
|
|
|
- While GET parameters can be sent with every request method, POST
|
|
|
+ While <constant>GET</constant> parameters can be sent with every request method, POST
|
|
|
parameters are only sent in the body of POST requests. Adding POST
|
|
|
- parameters to a request is very similar to adding GET parameters,
|
|
|
+ parameters to a request is very similar to adding <constant>GET</constant> parameters,
|
|
|
and can be done with the setParameterPost() method, which is
|
|
|
similar to the setParameterGet() method in structure.
|
|
|
|
|
|
@@ -295,7 +298,7 @@ $client->setParameterPost(array(
|
|
|
]]></programlisting>
|
|
|
</example>
|
|
|
|
|
|
- Note that when sending POST requests, you can set both GET and
|
|
|
+ Note that when sending POST requests, you can set both <constant>GET</constant> and
|
|
|
POST parameters. On the other hand, while setting POST parameters
|
|
|
for a non-POST request will not trigger and error, it is useless.
|
|
|
Unless the request is a POST request, POST parameters are simply
|