HTTP_EMPTY_ARGS(getResponseMessage, 1);
HTTP_EMPTY_ARGS(getRequestMessage, 1);
HTTP_EMPTY_ARGS(getHistory, 1);
+HTTP_EMPTY_ARGS(clearHistory, 0);
HTTP_EMPTY_ARGS(send, 1);
HTTP_BEGIN_ARGS(get, 0, 1)
HTTP_REQUEST_ME(getResponseMessage, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getRequestMessage, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getHistory, ZEND_ACC_PUBLIC)
+ HTTP_REQUEST_ME(clearHistory, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ALIAS(get, http_get)
HTTP_REQUEST_ALIAS(head, http_head)
o = ecalloc(1, sizeof(http_request_object));
o->zo.ce = ce;
o->ch = curl_easy_init();
- o->pool = NULL;
phpstr_init(&o->history);
phpstr_init(&o->request);
DCL_PROP(PUBLIC, bool, recordHistory, 1);
+#ifndef WONKY
/*
* Request Method Constants
*/
DCL_CONST(long, "AUTH_NTLM", CURLAUTH_NTLM);
DCL_CONST(long, "AUTH_ANY", CURLAUTH_ANY);
# endif /* LIBCURL_VERSION_NUM */
+#endif /* WONKY */
}
void _http_request_object_free(zend_object *object TSRMLS_DC)
}
/* }}} */
+/* {{{ proto HttpMessage HttpRequest::getHistory()
+ *
+ * Get all sent requests and received responses as an HttpMessage object.
+ */
PHP_METHOD(HttpRequest, getHistory)
{
NO_ARGS;
SET_EH_NORMAL();
}
}
+/* }}} */
+
+/* {{{ proto void HttpRequest::clearHistory()
+ *
+ * Clear the history.
+ */
+PHP_METHOD(HttpRequest, clearHistory)
+{
+ NO_ARGS {
+ getObject(http_request_object, obj);
+ phpstr_dtor(&obj->history);
+ }
+}
+/* }}} */
/* {{{ proto HttpMessage HttpRequest::send()
*