[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Using http_url_post wit webform
Good morning Scott,
I just wanted to touch base and see if you received my email last week
with the parameter information. Did I get it to the right place?
Thanks,
Vicki
-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott
Klement
Sent: Thursday, November 12, 2009 5:59 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: Using http_url_post wit webform
Hey Vicki,
Would it be alright if I tried this out for myself on my own box? That
might help me see where things are going wrong.
If so, I guess I'll need the values for 'service', 'name', and
'cleartext'. (If they are private, you can send them to me at the
"from" address of this e-mail, instead of sending to the mailing list.)
Thanks...
Vicki S. Coday wrote:
> Hi Scott,
>
> Thanks so much for the reply. Now I'm really confused though. The
> scenario that I thought required a GET works just fine with the POST.
> It is the second scenario that "hangs" for me. I do want to do a post
> of the form. I have attached my debug session.
>
> Here is the code snippet...
> eval Form = WEBFORM_open
>
> callp WEBFORM_SetVar(Form: 'service': service)
> callp WEBFORM_SetVar(Form: 'name': name)
> callp WEBFORM_SetVar(Form: 'cleartext': cleartext)
>
> callp WEBFORM_postData( Form : myPointer
> : dataSize )
>
> eval rc = http_url_post(
> 'https://trig.basspronews.com' +
> '/api/xmlapi'
> : myPointer
> : dataSize
> : '/tmp/testpost.html'
> : HTTP_TIMEOUT
> : HTTP_USERAGENT
> : 'application/x-www-form-urlencoded' )
>
>
>
> Thanks,
> Vicki
>
> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott
> Klement
> Sent: Thursday, November 12, 2009 4:09 PM
> To: HTTPAPI and FTPAPI Projects
> Subject: 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
>
-----------------------------------------------------------------------
>
>
>
------------------------------------------------------------------------
>
>
-----------------------------------------------------------------------
> This is the FTPAPI mailing list. To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
>
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------