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

RE: url encode http_url_get_raw



Robert,

>From the debug log for USPSVERIFY (program in message). I cut off the GET line, but you can see the XML part and you can see the encoding %3C.

GET /ShippingAPItest.dll?API=Verify&XML=%3CAddressValidateRe...
Host: testing.shippingapis.com                              

So this is pretty typical GET to the host test.shippingapis.com. The host is expecting two parameters (API and XML). The URI put together would look like this:

http://testing.shippingapis.com/ShippingAPItest.dll?API=Verify&XML=%3CAddressValidateRe...

The ShippingAPItest.dll is a pointer to some program that runs on the server and the parameters start after the "?". The first parameter is API. The next parameter is delimited by the "&". There you see the encoded parameter from the program XML. This is standard GET version of passing parameters.

> what would this need to be for a typical GET set of parameters?
There is no typical GET set of parameters. That depends on your service. What are you connecting to? What is it expecting for parms? Following the outline above, you would have something like

http://Host/pointerToProgram?parm1=encodedparmValue1&parm2=encodedparmValue2

Mike

 

> -----Original Message-----
> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-
> bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Robert Upshall
> Sent: Wednesday, December 16, 2009 8:54 AM
> To: HTTPAPI and FTPAPI Projects
> Subject: Re: url encode http_url_get_raw
> 
> Thanks for the link Mike,
> 
> <snip>
> 
> // encode the address request
>        Enc = http_url_encoder_new();
>        rc2 = http_url_encoder_addvar( Enc:
>            'XML':
>            %addr(addressRequest) + 2:
>            %len(addressRequest));
>        bigString = http_url_encoder_getstr( Enc );
> 
> </snip>
> 
> It looks like that is what I was looking for, in this sample its using
> 'XML' ,   what would this need to be for a typical GET set of
> parameters?
> 
> Also, can somebody explain the +2 in %addr(addressRequest) + 2:?
> 
> Thanks,
> Robert
> 
> 
> 
> Mike Krebs wrote:
> > Robert,
> >
> > Something similar...
> > http://www.scottklement.com/archives/ftpapi/200906/msg00110.html
> >
> >
> >
> >
> >> -----Original Message-----
> >> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-
> >> bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Robert Upshall
> >> Sent: Wednesday, December 16, 2009 7:17 AM
> >> To: HTTPAPI and FTPAPI Projects
> >> Subject: Re: url encode http_url_get_raw
> >>
> >> Hi Scott,
> >>
> >> That is true, I wasn't thinking about it like that.
> >>
> >> I looked at the ENCODERR4 src and I see allot of methods I think I
> need
> >> to use "url_encode()" on the parm section of my URL but I don't see
> any
> >> of the examples using this method?  Is this the method I need to be
> >> using?  Are there any examples of it being used?
> >>
> >> Thanks,
> >> Robert
> >>
> >>
> >>
> >>
> >> Scott Klement wrote:
> >>
> >>> Hi Robert,
> >>>
> >>> How would HTTPAPI know which parts of your URL are intended to be
> >>>
> >> taken
> >>
> >>> literally, and which parts are intended to be encoded?!
> >>>
> >>> If you need to URL encode your URL, then please call the URL
> encoder
> >>> routines.
> >>>
> >>>
> >>>
> >>> Robert Upshall wrote:
> >>>
> >>>
> >>>> Do I need to do anything special to make http_url_get_raw encode
> the
> >>>>
> >> URL
> >>
> >>>> before it makes the server request?
> >>>>
> >>>> Here is call to http_url_get_raw:
> >>>>
> >>>>      rc=http_url_get_raw(%trim(url):1:%paddr('INCOMING'));
> >>>>
> >>>> I'd like to make sure the field "url" is encoded.
> >>>>
> >>>>
> >>> -------------------------------------------------------------------
> --
> >>>
> >> --
> >>
> >>> 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
> -----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------