Does xbuf_frurl () support HTTP_POST?

So far, I've seen examples of using xbuf_frurl () with the HTTP_GET method. Does this function in g-wan support HTTP_POST? If so, how can I post the POST data?

Thank.

+3


source to share


2 answers


I think you will need curl library for such a request (see http://gwan.com/developers part)

http://curl.haxx.se/libcurl/c/



and here is a sample of g-wan

http://gwan.com/source/curl.c

0


source


The xbuf_frurl()

G-WAN API call can be used with HTTP_POST

when providing parameters x-www-form-urlencoded

:

xbuf_frurl(xbuf, "gwan.com", 80, HTTP_POST, "/?form", 1000, "&arg1=123&arg2=456");

      

BTW, the following version brings a flag HTTPS

to use SSL:



xbuf_frurl(xbuf, "gwan.com", 443, HTTPS | HTTP_POST, "/?form", 1000, "&arg1=123&arg2=456");

      

Both calls are more concise than libcURL, and it seems unlikely to be done in a "less verbose" way (than one line of code).

Hope it helps.

0


source







All Articles