The "POST" method


#1

Hello everybody,

I’m newbie on WIP library,
I try to use the POST method to send data to a PHP file (on HTTP server : Apache 2.2).
At the beginning, I used the GET method (URL/file.php?data =…) but the size of data is very limited, thus I should use the POST to send a bigger data (my data is a binary data translate in base64)
and I have few questions :

  • For POST method, with option “WIP_HTTP_METHOD_POST”, should I use the function wip_getFileOpts() or the function wip_putFileOpts() (I have not understood the difference…)
  • How do you send my data, with wip_write (but with the function wip_getFileOpts, there are not WIP_CEV_WRITE event in call back) or with the data integrated in URL ?

Thanks for your reply,

Paul


#2

The option “WIP_HTTP_METHOD_POST” can be used with both the wip_getFileOpts () and the wip_putFileOpts () function. The difference between the wip_getFileOpts () and the wip_putFileOpts () functions lies in the HTTP methods supported by them by default.
The wip_getFileOpts () function supports the GET method by default unless explicitly changed, and the wip_putFileOpts () function supports the PUT method by default unless explicitly changed.

I think the better way is to write the data using the wip_write () function. After using the wip_getFileOpts () function, the WIP_CEV_OPEN and then the WIP_CEV_WRITE events will be received in call back functions. You can refer the http_get sample provided with the plug-in.


#3

Thank you for your reply paruthiv.
I have succeeded to Post data to my server.