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

Re: http_url_get problem



What you're doing should work, I think... I don't see any problems. There must be something else going on here -- maybe you have a proxy or something that requires authentication, first?

On 11/28/2012 3:47 AM, Roberto Tempesti wrote:
    Hi all,
    I'm trying to consume a web service to get tracking info from an
    express carrier.
    That company gave me a "guide" where I found the method that I'm going
    to use as per the above string:
    http://www.gls-italy.com/scripts/cgiip.exe/get_xml_track.p?locpartenza=
    <siglasede>&NumSped=<numerospedizione>&CodCli=<codicecliente>
    I thought that the method I have to work with is "GET" so I used
    http_url_get procedure in this way:
    rc = http_url_get( %trim(url) : 'gls_tracking_get.xml' );
    where "url" variable contains the above value:
    http://www.gls-italy.com/scripts/cgiip.exe/get_xml_track.p?locpartenza=
    T1&NumSped=520113341&CodCli=2583
    Well, if I put this string in IE Browser I get back XML data so I think
    that the request is right.
    When I run the same string with http_url_get I get an error "400"
    "Request URL is invalid".
    This is what I found inside the debug file:
    HTTPAPI Ver 1.24 released 2012-01-23

    OS/400 Ver V5R4M0



    New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0

    http_url_get(): 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: xxxxxxxxx.yy
    DNS server found: 192.168.x.x

    http_persist_get(): entered

    http_persist_req(GET) entered.

    http_long_ParseURL(): entered

    do_oper(GET): entered

    There are 0 cookies in the cache

    GET
    /scripts/cgiip.exe/get_xml_track.p?locpartenza=T1&NumSped=520113341&Cod
    Cli=2583
    Host: www.gls-italy.com
    User-Agent: http-api/1.24


    recvresp(): entered
    HTTP/1.1 400 Bad Request
    Content-Type: text/html; charset=us-ascii
    Server: Microsoft-HTTPAPI/2.0
    Date: Wed, 28 Nov 2012 09:32:06 GMT
    Connection: close
    Content-Length: 324


    SetError() £13: HTTP/1.1 400 Bad Request
    recvresp(): end with 400
    recvdoc parms: identity 324
    header_load_cookies() entered
    recvdoc(): entered
    SetError() £0:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML
    4.01//EN""http://www.w3.org/TR/html4/strict.dtd";>
    <HTML><HEAD><TITLE>Bad Request</TITLE>

    <META HTTP-EQUIV="Content-Type" Content="text/html;
    charset=us-ascii"></HEAD>
    <BODY><h2>Bad Request - Invalid URL</h2>

    <hr><p>HTTP Error 400. The request URL is invalid.</p>

    </BODY></HTML>



    SetError() £13: HTTP/1.1 400 Bad Request

    http_close(): entered
    Can anyone help me? If you need more info pls ask.
    Thank you so much.



-----------------------------------------------------------------------
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
-----------------------------------------------------------------------