+ SET_EH_THROW_HTTP();
+ if ((msg = http_message_parse(PHPSTR_VAL(&obj->request->conv.request), PHPSTR_LEN(&obj->request->conv.request)))) {
+ RETVAL_OBJVAL(http_message_object_new_ex(http_message_object_ce, msg, NULL), 0);
+ }
+ SET_EH_NORMAL();
+ }
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getRawRequestMessage()
+ *
+ * Get sent HTTP message.
+ *
+ * Returns an HttpMessage in a form of a string
+ */
+PHP_METHOD(HttpRequest, getRawRequestMessage)
+{
+ NO_ARGS;
+
+ if (return_value_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 (return_value_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.
+ *
+ * If you want to record history, set the instance variable
+ * HttpRequest::$recordHistory to TRUE.
+ *
+ * Returns an HttpMessage object representing the complete request/response
+ * history.
+ *
+ * The object references the last received response, use HttpMessage::getParentMessage()
+ * to access the data of previously sent requests and received responses.
+ *
+ * Throws HttpRuntimeException.
+ */
+PHP_METHOD(HttpRequest, getHistory)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ zval *hist;
+
+ SET_EH_THROW_HTTP();
+ hist = GET_PROP(history);
+ if (Z_TYPE_P(hist) == IS_OBJECT) {
+ RETVAL_OBJECT(hist, 1);