void php_http_client_options_set_subr(zval *this_ptr, char *key, size_t len, zval *opts, int overwrite);
void php_http_client_options_set(zval *this_ptr, zval *opts);
void php_http_client_options_get_subr(zval *this_ptr, char *key, size_t len, zval *return_value);
void php_http_client_options_set_subr(zval *this_ptr, char *key, size_t len, zval *opts, int overwrite);
void php_http_client_options_set(zval *this_ptr, zval *opts);
void php_http_client_options_get_subr(zval *this_ptr, char *key, size_t len, zval *return_value);
zval *zheaders = NULL, *zbody = NULL, *zurl = NULL;
php_http_message_object_t *obj;
zval *zheaders = NULL, *zbody = NULL, *zurl = NULL;
php_http_message_object_t *obj;
- php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|s!z!a!O!", &meth_str, &meth_len, &zurl, &zheaders, &zbody, php_http_message_body_class_entry), invalid_arg, return);
+ php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|s!z!a!O!", &meth_str, &meth_len, &zurl, &zheaders, &zbody, php_http_get_message_body_class_entry()), invalid_arg, return);
- PHP_HTTP_INFO(obj->message).request.url = php_http_url_from_zval(zurl, ~0);
+ php_http_url_t *url = php_http_url_from_zval(zurl, PHP_HTTP_URL_STDFLAGS);
+
+ if (url) {
+ PHP_HTTP_INFO(obj->message).request.url = php_http_url_mod(url, NULL, PHP_HTTP_URL_STDFLAGS);
+ php_http_url_free(&url);
+ }
static PHP_METHOD(HttpClientRequest, getOptions)
{
if (SUCCESS == zend_parse_parameters_none()) {
static PHP_METHOD(HttpClientRequest, getOptions)
{
if (SUCCESS == zend_parse_parameters_none()) {
- zval tmp, *zoptions = zend_read_property(php_http_client_request_class_entry, getThis(), ZEND_STRL("options"), 0, &tmp);
+ zval tmp, *zoptions = zend_read_property(php_http_client_request_class_entry, Z_OBJ_P(ZEND_THIS), ZEND_STRL("options"), 0, &tmp);
- PHP_ME(HttpClientRequest, __construct, ai_HttpClientRequest___construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
+ PHP_ME(HttpClientRequest, __construct, ai_HttpClientRequest___construct, ZEND_ACC_PUBLIC)
PHP_ME(HttpClientRequest, setContentType, ai_HttpClientRequest_setContentType, ZEND_ACC_PUBLIC)
PHP_ME(HttpClientRequest, getContentType, ai_HttpClientRequest_getContentType, ZEND_ACC_PUBLIC)
PHP_ME(HttpClientRequest, setQuery, ai_HttpClientRequest_setQuery, ZEND_ACC_PUBLIC)
PHP_ME(HttpClientRequest, setContentType, ai_HttpClientRequest_setContentType, ZEND_ACC_PUBLIC)
PHP_ME(HttpClientRequest, getContentType, ai_HttpClientRequest_getContentType, ZEND_ACC_PUBLIC)
PHP_ME(HttpClientRequest, setQuery, ai_HttpClientRequest_setQuery, ZEND_ACC_PUBLIC)
PHP_MINIT_FUNCTION(http_client_request)
{
zend_class_entry ce = {0};
INIT_NS_CLASS_ENTRY(ce, "http\\Client", "Request", php_http_client_request_methods);
PHP_MINIT_FUNCTION(http_client_request)
{
zend_class_entry ce = {0};
INIT_NS_CLASS_ENTRY(ce, "http\\Client", "Request", php_http_client_request_methods);
zend_declare_property_null(php_http_client_request_class_entry, ZEND_STRL("options"), ZEND_ACC_PROTECTED);
zend_declare_property_null(php_http_client_request_class_entry, ZEND_STRL("options"), ZEND_ACC_PROTECTED);