HTTP_ARG_VAL(name, 0)
HTTP_END_ARGS;
-HTTP_EMPTY_ARGS(getResponseMessage, 1);
-HTTP_EMPTY_ARGS(getRequestMessage, 1);
-HTTP_EMPTY_ARGS(getHistory, 1);
+HTTP_EMPTY_ARGS(getResponseMessage, 0);
+HTTP_EMPTY_ARGS(getRawResponseMessage, 0);
+HTTP_EMPTY_ARGS(getRequestMessage, 0);
+HTTP_EMPTY_ARGS(getRawRequestMessage, 0);
+HTTP_EMPTY_ARGS(getHistory, 0);
HTTP_EMPTY_ARGS(clearHistory, 0);
-HTTP_EMPTY_ARGS(send, 1);
+HTTP_EMPTY_ARGS(send, 0);
HTTP_BEGIN_ARGS(get, 0, 1)
HTTP_ARG_VAL(url, 0)
HTTP_REQUEST_ME(getResponseBody, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getResponseInfo, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getResponseMessage, ZEND_ACC_PUBLIC)
+ HTTP_REQUEST_ME(getRawResponseMessage, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getRequestMessage, ZEND_ACC_PUBLIC)
+ HTTP_REQUEST_ME(getRawRequestMessage, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getHistory, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(clearHistory, ZEND_ACC_PUBLIC)
}
/* }}} */
+/* {{{ proto string HttpRequest::getRawRequestMessage()
+ *
+ * Get sent HTTP message.
+ *
+ * Returns an HttpMessage in a form of a string
+ *
+ */
+PHP_METHOD(HttpRequest, getRawRequestMessage)
+{
+ NO_ARGS;
+
+ IF_RETVAL_USED {
+ getObject(http_request_object, obj);
+
+ RETURN_PHPSTR_DUP(&obj->request->conv.request);
+ }
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getRawResponseMessage()
+ *
+ * Get the entire HTTP response.
+ *
+ * Returns the complete web server response, including the headers in a form of a string.
+ *
+ */
+PHP_METHOD(HttpRequest, getRawResponseMessage)
+{
+ NO_ARGS;
+
+ IF_RETVAL_USED {
+ getObject(http_request_object, obj);
+
+ RETURN_PHPSTR_DUP(&obj->request->conv.response);
+ }
+}
+/* }}} */
+
/* {{{ proto HttpMessage HttpRequest::getHistory()
*
* Get all sent requests and received responses as an HttpMessage object.
PHP_METHOD(HttpRequest, getResponseBody);
PHP_METHOD(HttpRequest, getResponseInfo);
PHP_METHOD(HttpRequest, getResponseMessage);
+PHP_METHOD(HttpRequest, getRawResponseMessage);
PHP_METHOD(HttpRequest, getRequestMessage);
+PHP_METHOD(HttpRequest, getRawRequestMessage);
PHP_METHOD(HttpRequest, getHistory);
PHP_METHOD(HttpRequest, clearHistory);
#define RETURN_PHPSTR_PTR(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_PTR, 0)
#define RETURN_PHPSTR_VAL(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_NOT, 0)
+#define RETURN_PHPSTR_DUP(STR) RETURN_PHPSTR((STR), PHPSTR_FREE_NOT, 1)
#define RETVAL_PHPSTR_PTR(STR) RETVAL_PHPSTR((STR), PHPSTR_FREE_PTR, 0)
#define RETVAL_PHPSTR_VAL(STR) RETVAL_PHPSTR((STR), PHPSTR_FREE_NOT, 0)
+#define RETVAL_PHPSTR_DUP(STR) RETVAĆ_PHPSTR((STR), PHPSTR_FREE_NOT, 1)
/* RETURN_PHPSTR(buf, PHPSTR_FREE_PTR, 0) */
#define RETURN_PHPSTR(STR, free, dup) \
RETVAL_PHPSTR((STR), (free), (dup)); \