Permalink
Browse files

http, break: deprecated http.find.

  • Loading branch information...
xicilion committed Nov 1, 2017
1 parent a3e91bb commit 0fe6b96a546d7e52aaa53745913f2ca02a79a83a
@@ -46,7 +46,6 @@ class HttpClient : public HttpClient_base {
virtual result_t del(exlib::string url, v8::Local<v8::Object> headers, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
virtual result_t put(exlib::string url, v8::Local<v8::Object> headers, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
virtual result_t patch(exlib::string url, v8::Local<v8::Object> headers, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
virtual result_t find(exlib::string url, v8::Local<v8::Object> headers, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
public:
result_t request(exlib::string method, exlib::string url, SeekableStream_base* body,
@@ -44,7 +44,6 @@ class HttpClient_base : public object_base {
virtual result_t del(exlib::string url, v8::Local<v8::Object> opts, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac) = 0;
virtual result_t put(exlib::string url, v8::Local<v8::Object> opts, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac) = 0;
virtual result_t patch(exlib::string url, v8::Local<v8::Object> opts, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac) = 0;
virtual result_t find(exlib::string url, v8::Local<v8::Object> opts, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac) = 0;
public:
template <typename T>
@@ -69,7 +68,6 @@ class HttpClient_base : public object_base {
static void s_del(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_put(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_patch(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_find(const v8::FunctionCallbackInfo<v8::Value>& args);
public:
ASYNC_MEMBERVALUE3(HttpClient_base, request, Stream_base*, HttpRequest_base*, obj_ptr<HttpResponse_base>);
@@ -79,7 +77,6 @@ class HttpClient_base : public object_base {
ASYNC_MEMBERVALUE3(HttpClient_base, del, exlib::string, v8::Local<v8::Object>, obj_ptr<HttpResponse_base>);
ASYNC_MEMBERVALUE3(HttpClient_base, put, exlib::string, v8::Local<v8::Object>, obj_ptr<HttpResponse_base>);
ASYNC_MEMBERVALUE3(HttpClient_base, patch, exlib::string, v8::Local<v8::Object>, obj_ptr<HttpResponse_base>);
ASYNC_MEMBERVALUE3(HttpClient_base, find, exlib::string, v8::Local<v8::Object>, obj_ptr<HttpResponse_base>);
};
}
@@ -102,9 +99,7 @@ inline ClassInfo& HttpClient_base::class_info()
{ "put", s_put, false },
{ "putSync", s_put, false },
{ "patch", s_patch, false },
{ "patchSync", s_patch, false },
{ "find", s_find, false },
{ "findSync", s_find, false }
{ "patchSync", s_patch, false }
};
static ClassData::ClassProperty s_property[] = {
@@ -428,28 +423,6 @@ inline void HttpClient_base::s_patch(const v8::FunctionCallbackInfo<v8::Value>&
METHOD_RETURN();
}
inline void HttpClient_base::s_find(const v8::FunctionCallbackInfo<v8::Value>& args)
{
obj_ptr<HttpResponse_base> vr;
METHOD_NAME("HttpClient.find");
METHOD_INSTANCE(HttpClient_base);
METHOD_ENTER();
ASYNC_METHOD_OVER(2, 1);
ARG(exlib::string, 0);
OPT_ARG(v8::Local<v8::Object>, 1, v8::Object::New(isolate));
if (!cb.IsEmpty()) {
pInst->acb_find(v0, v1, cb);
hr = CALL_RETURN_NULL;
} else
hr = pInst->ac_find(v0, v1, vr);
METHOD_RETURN();
}
}
#endif
View
@@ -50,7 +50,6 @@ class http_base : public object_base {
static result_t del(exlib::string url, v8::Local<v8::Object> opts, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
static result_t put(exlib::string url, v8::Local<v8::Object> opts, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
static result_t patch(exlib::string url, v8::Local<v8::Object> opts, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
static result_t find(exlib::string url, v8::Local<v8::Object> opts, obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac);
public:
static void s__new(const v8::FunctionCallbackInfo<v8::Value>& args)
@@ -82,7 +81,6 @@ class http_base : public object_base {
static void s_del(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_put(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_patch(const v8::FunctionCallbackInfo<v8::Value>& args);
static void s_find(const v8::FunctionCallbackInfo<v8::Value>& args);
public:
ASYNC_STATICVALUE3(http_base, request, Stream_base*, HttpRequest_base*, obj_ptr<HttpResponse_base>);
@@ -92,7 +90,6 @@ class http_base : public object_base {
ASYNC_STATICVALUE3(http_base, del, exlib::string, v8::Local<v8::Object>, obj_ptr<HttpResponse_base>);
ASYNC_STATICVALUE3(http_base, put, exlib::string, v8::Local<v8::Object>, obj_ptr<HttpResponse_base>);
ASYNC_STATICVALUE3(http_base, patch, exlib::string, v8::Local<v8::Object>, obj_ptr<HttpResponse_base>);
ASYNC_STATICVALUE3(http_base, find, exlib::string, v8::Local<v8::Object>, obj_ptr<HttpResponse_base>);
};
}
@@ -122,9 +119,7 @@ inline ClassInfo& http_base::class_info()
{ "put", s_put, true },
{ "putSync", s_put, true },
{ "patch", s_patch, true },
{ "patchSync", s_patch, true },
{ "find", s_find, true },
{ "findSync", s_find, true }
{ "patchSync", s_patch, true }
};
static ClassData::ClassObject s_object[] = {
@@ -440,27 +435,6 @@ inline void http_base::s_patch(const v8::FunctionCallbackInfo<v8::Value>& args)
METHOD_RETURN();
}
inline void http_base::s_find(const v8::FunctionCallbackInfo<v8::Value>& args)
{
obj_ptr<HttpResponse_base> vr;
METHOD_NAME("http.find");
METHOD_ENTER();
ASYNC_METHOD_OVER(2, 1);
ARG(exlib::string, 0);
OPT_ARG(v8::Local<v8::Object>, 1, v8::Object::New(isolate));
if (!cb.IsEmpty()) {
acb_find(v0, v1, cb);
hr = CALL_RETURN_NULL;
} else
hr = ac_find(v0, v1, vr);
METHOD_RETURN();
}
}
#endif
@@ -627,10 +627,4 @@ result_t HttpClient::patch(exlib::string url, v8::Local<v8::Object> headers,
{
return request("PATCH", url, headers, retVal, ac);
}
result_t HttpClient::find(exlib::string url, v8::Local<v8::Object> headers,
obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac)
{
return request("FIND", url, headers, retVal, ac);
}
}
View
@@ -135,10 +135,4 @@ result_t http_base::patch(exlib::string url, v8::Local<v8::Object> headers,
{
return get_httpClient(ac->isolate())->patch(url, headers, retVal, ac);
}
result_t http_base::find(exlib::string url, v8::Local<v8::Object> headers,
obj_ptr<HttpResponse_base>& retVal, AsyncEvent* ac)
{
return get_httpClient(ac->isolate())->find(url, headers, retVal, ac);
}
}
View
@@ -142,21 +142,4 @@ interface HttpClient : object
@return 返回服务器响应
*/
HttpResponse patch(String url, Object opts = {}) async;
/*! @brief 用 FIND 方法请求指定的 url,并返回结果,等同于 request("PATCH", ...)
opts 包含请求的附加选项,支持的内容如下:
```JavaScript
{
"query": {},
"body": SeekedStream | Buffer | String | {},
"json": {},
"headers": {}
}
```
其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息
@param url 指定 url,必须是包含主机的完整 url
@param opts 指定附加信息
@return 返回服务器响应
*/
HttpResponse find(String url, Object opts = {}) async;
};
View
@@ -161,21 +161,4 @@ module http
@return 返回服务器响应
*/
static HttpResponse patch(String url, Object opts = {}) async;
/*! @brief 用 FIND 方法请求指定的 url,并返回结果,等同于 request("PATCH", ...)
opts 包含请求的附加选项,支持的内容如下:
```JavaScript
{
"query": {},
"body": SeekedStream | Buffer | String | {},
"json": {},
"headers": {}
}
```
其中 body,json 不得同时出现。缺省为 {},不包含任何附加信息
@param url 指定 url,必须是包含主机的完整 url
@param opts 指定附加信息
@return 返回服务器响应
*/
static HttpResponse find(String url, Object opts = {}) async;
};

0 comments on commit 0fe6b96

Please sign in to comment.