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

RE: Using http_url_post wit webform



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
-----------------------------------------------------------------------
HTTPAPI Ver 1.23 released 2008-04-24
OS/400 Ver V5R4M0

New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0
http_url_post(): entered
http_persist_open(): entered
http_long_ParseURL(): entered
DNS resolver retrans: 2
DNS resolver retry  : 2
DNS resolver options: x'00000136'
DNS default domain: basspro.net
DNS server found: 10.33.80.102
DNS server found: 10.33.80.103
https_init(): entered
-------------------------------------------------------------------------------------
Dump of local-side certificate information:
-------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------
Dump of server-side certificate information:
-------------------------------------------------------------------------------------
Cert Validation Code = 6000
-----BEGIN CERTIFICATE-----
MIIFSjCCBDKgAwIBAgIQa0vUtFG2lgzFPKysqKeYSDANBgkqhkiG9w0BAQUFADCB
tTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL
ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTswOQYDVQQLEzJUZXJtcyBvZiB1c2Ug
YXQgaHR0cHM6Ly93d3cudmVyaXNpZ24uY29tL3JwYSAoYykwOTEvMC0GA1UEAxMm
VmVyaVNpZ24gQ2xhc3MgMyBTZWN1cmUgU2VydmVyIENBIC0gRzIwHhcNMDkwODEy
MDAwMDAwWhcNMTIwODEyMjM1OTU5WjCBujELMAkGA1UEBhMCVVMxETAPBgNVBAgT
CE5ldyBZb3JrMREwDwYDVQQHFAhOZXcgWW9yazEZMBcGA1UEChQQQ2hlZXRhaE1h
aWwgSW5jLjEXMBUGA1UECxQOV2Vic2VydmVyIFRlYW0xMzAxBgNVBAsUKlRlcm1z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M6pBPQZJcB2FQUto+RGA/XHHFu+nJ8J9PQNNyFd
RwiIOttfVYYxiOF/t/fHWRifyLhm/Tk6WM6SIx7QPX3itTXdVGJfy+gKvoCFkxiV
ICjIhpBNVKG4xRciPUhNfXfI0MFfS2Fr1kwaLkiPsmoOEVtUu2lbMRyRuuXV+KrM
Ku+cbisTLKjSwSNZNai/9x4/qAGkz1vj2xxBq8pIBZVKKSJ0iUb7y2TWovwfp+BM
59XtwnM61cQgGMYdcr4=
-----END CERTIFICATE-----
Serial Number: 6B:4B:D4:B4:51:B6:96:0C:C5:3C:AC:AC:A8:A7:98:48
Common Name: ebm.cheetahmail.com
Country: US
State/Province: New York
Locality: New York
Org Unit: CheetahMail Inc.
Org: Terms of use at www.verisign.com/rpa (c)05, OU=Webserver Team
Issuer CN: VeriSign Class 3 Secure Server CA - G2
Issuer Country: US
Issuer Org: VeriSign, Inc.
Issuer Org Unit: Terms of use at https://www.verisign.com/rpa (c)09, OU=VeriSign Trust Network
Version: 03
not before: 20090811180000
not after: 20120812175959
pub key alg: 1.2.840.113549.1.1.5

Protocol Used: TLS Version 1
http_persist_post(): entered
http_long_ParseURL(): entered
do_post(): entered
POST /api/xmlapi HTTP/1.1
Host: trig.basspronews.com
User-Agent: http-api/1.23
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue
Content-Length: 52


recvresp(): entered
HTTP/1.1 200 OK
Date: Thu, 12 Nov 2009 21:10:08 GMT
Server: Apache
Transfer-Encoding: chunked
Content-Type: text/xml


SetError() #13: HTTP/1.1 200 OK
recvdoc parms: chunked 0
header_load_cookies() entered
recvchunk(): entered
get_chunk_size(): entered
50 

chunk size = 80
get_chunk_size returned 80
calling comm_blockread
<?xml version="1.0" encoding="iso-8859-1" ?>
<document>HTTP/1.1 100 Continue


comm_blockread returned 80


get_chunk_size(): entered
SetError() #43: CommSSL_Read:  time-out!
get_chunk_size returned -2
http_close(): entered
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------