[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using http_url_post wit webform



Hi Vicki,

Vicki S. Coday wrote:

>    1.        This example works great.  I know that the action used here
>    is `GET' and the parameters are passed along in the url

Actually that's not at all what's happening.  http_url_post() always 
uses the POST action.  (That's why the routine is named "post".)  And 
you're not adding the parameters to the URL, you are sending them as 
POST data.

If you wanted to make it a GET request where you send the data in the 
URL, you'd need to code it like this:

c                   eval      rc = http_url_get(
c                              'http://proxy.espn.go.com/outdoors/' +
c                              'bassmaster/members/admin/basspro'
c                               + WEBFORM_getData(form)
c                             : '/tmp/testpost.html'
c                             : HTTP_TIMEOUT
c                             : HTTP_USERAGENT
c                             : *omit
c                             : 'application/x-www-form-urlencoded' )

In order to do a GET request, you have to call a GET routine, in the 
preceding example, that's HTTP_url_get().  In order to add the data on 
to a URI, you need to call WEBFORM_getData() and concatenate it to the 
URI, as shown above.


>    2.        This example I am not able to get a response from.  The only
>    difference that I know of is that the action used here would be `POST'
>    .  Had do I distinguish between the two on the api call?

There are separate APIs for POST and GET.  You need to call the 
appropriate one...
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------