<p>Set the body of the HttpMessage.<br />
NOTE: Don't forget to update any headers accordingly.</p>
<p>Expects a string parameter containing the new body of the message.</p>
+<h3 id="HttpMessage_getHeader">string HttpMessage::getHeader(string header)</h3>
+<p>Get message header.</p>
+<p>Returns the header value on success or NULL if the header does not exist.</p>
<h3 id="HttpMessage_getHeaders">array HttpMessage::getHeaders()</h3>
<p>Get Message Headers.</p>
<p>Returns an associative array containing the messages HTTP headers.</p>
<li><a href="#HttpMessage_fromString">HttpMessage::fromString()</a></li>
<li><a href="#HttpMessage_getBody">HttpMessage::getBody()</a></li>
<li><a href="#HttpMessage_setBody">HttpMessage::setBody()</a></li>
+<li><a href="#HttpMessage_getHeader">HttpMessage::getHeader()</a></li>
<li><a href="#HttpMessage_getHeaders">HttpMessage::getHeaders()</a></li>
<li><a href="#HttpMessage_setHeaders">HttpMessage::setHeaders()</a></li>
<li><a href="#HttpMessage_addHeaders">HttpMessage::addHeaders()</a></li>
</li>
</ul>
</div>
- <p><b>Generated at: Thu, 06 Jul 2006 20:17:57 +0200</b></p>
+ <p><b>Generated at: Fri, 07 Jul 2006 13:48:43 +0200</b></p>
</body>
</html>
HTTP_ARG_VAL(body, 0)
HTTP_END_ARGS;
+HTTP_BEGIN_ARGS(getHeader, 1)
+ HTTP_ARG_VAL(header, 0)
+HTTP_END_ARGS;
+
HTTP_EMPTY_ARGS(getHeaders);
HTTP_BEGIN_ARGS(setHeaders, 1)
HTTP_ARG_VAL(headers, 0)
HTTP_MESSAGE_ME(__construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
HTTP_MESSAGE_ME(getBody, ZEND_ACC_PUBLIC)
HTTP_MESSAGE_ME(setBody, ZEND_ACC_PUBLIC)
+ HTTP_MESSAGE_ME(getHeader, ZEND_ACC_PUBLIC)
HTTP_MESSAGE_ME(getHeaders, ZEND_ACC_PUBLIC)
HTTP_MESSAGE_ME(setHeaders, ZEND_ACC_PUBLIC)
HTTP_MESSAGE_ME(addHeaders, ZEND_ACC_PUBLIC)
}
/* }}} */
+/* {{{ proto string HttpMessage::getHeader(string header)
+ *
+ * Get message header.
+ *
+ * Returns the header value on success or NULL if the header does not exist.
+ */
+PHP_METHOD(HttpMessage, getHeader)
+{
+ zval *header;
+ char *orig_header, *nice_header;
+ int header_len;
+ getObject(http_message_object, obj);
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &orig_header, &header_len)) {
+ RETURN_FALSE;
+ }
+
+ nice_header = pretty_key(estrndup(orig_header, header_len), header_len, 1, 1);
+ if ((header = http_message_header_ex(obj->message, nice_header, header_len + 1))) {
+ RETVAL_ZVAL(header, 1, 0);
+ }
+ efree(nice_header);
+}
+/* }}} */
+
/* {{{ proto array HttpMessage::getHeaders()
*
* Get Message Headers.
<license>BSD, revised</license>
<notes><![CDATA[
* Fixed HttpResponse::capture() failure if buffered output exceeds 40k
-* Added HttpQueryString::mod() method
+* Added HttpQueryString::mod(array $params) method
+* Added HttpMessage::get(string $name) method
]]></notes>
<contents>
<dir name="/">
PHP_METHOD(HttpMessage, __construct);
PHP_METHOD(HttpMessage, getBody);
PHP_METHOD(HttpMessage, setBody);
+PHP_METHOD(HttpMessage, getHeader);
PHP_METHOD(HttpMessage, getHeaders);
PHP_METHOD(HttpMessage, setHeaders);
PHP_METHOD(HttpMessage, addHeaders);