[GB.NET.CURL]

* BUG: HttpClient.Put() method should send its data correctly now.
* NEW: HttpClient.PutFile() is a new method to send a PUT request by taking
  the data from a file.


git-svn-id: svn://localhost/gambas/trunk@6423 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2014-08-22 20:22:54 +00:00
parent 2e1e13e036
commit 4341abc468

View File

@ -567,7 +567,14 @@ END_METHOD
BEGIN_METHOD(HttpClient_Put, GB_STRING contentType; GB_STRING data; GB_OBJECT headers; GB_STRING target)
http_send(THIS, SEND_PUT, GB.ToZeroString(ARG(contentType)), GB.ToZeroString(ARG(data)), 0, VARG(headers), MISSING(target) ? NULL : GB.ToZeroString(ARG(target)));
http_send(THIS, SEND_PUT, GB.ToZeroString(ARG(contentType)), STRING(data), LENGTH(data), VARGOPT(headers, NULL), MISSING(target) ? NULL : GB.ToZeroString(ARG(target)));
END_METHOD
BEGIN_METHOD(HttpClient_PutFile, GB_STRING contentType; GB_STRING file; GB_OBJECT headers; GB_STRING target)
http_send(THIS, SEND_PUT | SEND_FILE, GB.ToZeroString(ARG(contentType)), STRING(file), LENGTH(file), VARGOPT(headers, NULL), MISSING(target) ? NULL : GB.ToZeroString(ARG(target)));
END_METHOD
@ -593,6 +600,7 @@ GB_DESC CHttpClientDesc[] =
GB_METHOD("Post", NULL, HttpClient_Post, "(ContentType)s(Data)s[(Headers)String[];(TargetFile)s]"),
GB_METHOD("Put", NULL, HttpClient_Put, "(ContentType)s(Data)s[(Headers)String[];(TargetFile)s]"),
GB_METHOD("PostFile", NULL, HttpClient_PostFile, "(ContentType)s(Path)s[(Headers)String[];(TargetFile)s]"),
GB_METHOD("PutFile", NULL, HttpClient_PutFile, "(ContentType)s(Path)s[(Headers)String[];(TargetFile)s]"),
GB_PROPERTY("Auth", "i", HttpClient_Auth),
GB_PROPERTY("CookiesFile", "s",HttpClient_CookiesFile),