[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Problem with Example15
Your technique won't work on any site that uses name-based virtual hosts.
This is simply not the proper technique. Neither is adding the host to
the host table -- adding the hosts to the host table is a major kludge,
but at least it'll work.
Your technique won't. At least not reliably. Sorry, but the HTTP
protocol was just not designed to work by IP address!
On 8/9/2010 2:42 PM, Robert Rogerson wrote:
>
> I am attempting Scott's new Example15 where he retrieves the top news
> stories from cnn.
> The biggest hurdle right now is that our shop DNS has been disabled on
> our development box so nothing goes out accidentally. I have been
> told that DNS nor host table entries will be allowed. I also read the
> notes at ([1]http://www.scottklement.com/httpapi/dns.html).
> For this reason I am hard coding an IP address in place of the host
> name.
> I retrieved the IP by (ping [2]rss.cnn.com) from my PC which did allow
> me to ping cnn.
> I then changed the folllowing url
> // ****************************************************
> // Download the latest news headlines from CNN
> // to a temporary file in the IFS
> // ****************************************************
> // url = '[3]http://rss.cnn.com/rss/cnn_topstories.rss';
> url = '[4]http://74.125.93.121/rss/cnn_topstories.rss';
> I have successfully run examples EXAMPLE18 and EXAMPLE19 using this
> same approach.
> When I try the cnn example my httpapi_debug.txt contains
> <snip>
> HTTPAPI Ver 1.23 released 2008-04-24
> OS/400 Ver V6R1M0
> 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: [5]KOHLANDFRISCH.COM
> WARNING: No name servers are configured for DNS resolution! You will
> not be able to contact Internet hosts! See
> [6]http://www.scottklement.com/httpapi/dns.html for more information.
> http_persist_get(): entered
> http_long_ParseURL(): entered
> do_get(): entered
> GET /rss/cnn_topstories.rss HTTP/1.1
> Host: 74.125.93.121
> User-Agent: http-api/1.23
> recvresp(): entered
> HTTP/1.1 404 Not Found
> Date: Fri, 06 Aug 2010 12:35:17 GMT
> Content-Type: text/html; charset=UTF-8
> Server: ghs
> Content-Length: 1376
> X-XSS-Protection: 0
> SetError() #13: HTTP/1.1 404 Not Found
> recvdoc parms: identity 1376
> header_load_cookies() entered
> recvdoc(): entered
> SetError() #0:
> </snip>
> Does anyone have any suggestions of alternate methods or why I am
> getting the 404 error? When I type in the address on my PC it works
> file.
> Thanks,
> Rob
> The following is in httpapi_debug.txt after an attempt.
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------