RSS problem
mncchartier
Posts: 68
I am trying my first IP connection and I keep getting an http 404 error. So here is what I have going on. I get a successful connection to the site then I try to GET the rss info and receive the 404 error.
I have tried the GET statement with the full url of http://sports.espn.com/espn/rss/news and as below with the resource
Line 1 (15:20:20):: Refresh Sent
Line 2 (15:20:20):: Time 14:20:19 - Updating ESPN RSS!33>$0D$0A
Line 3 (15:20:20):: Memory Available = 35937440 <57368>
Line 4 (15:22:50):: Connected Successfully
Line 5 (15:22:50):: CIpEvent::OnLine 0:8:1
Line 6 (15:22:50):: RSS Connected! line-<44>$0D$0A
Line 7 (15:22:50):: ESPN RSS Get Request Sent: line -<53>$0D$0A
Line 8 (15:22:52):: Memory Available = 35855184 <82256>
Line 9 (15:22:52):: 14:22:51.699 EVENT Started HttpContext[/]
Line 10 (15:22:52):: Memory Available = 35823376 <31808>
Line 11 (15:22:53):: Exiting TCP Read thread - closing this socket for local port 8
Line 12 (15:22:53):: Memory Available = 35775576 <47800>
Line 13 (15:22:53):: No RSS captured:491 bytes from server! line-<120>
Line 14 (15:22:53):: Not sent to Parse
Line 15 (15:22:53):: SendString 0:0:0 too long 283 truncated to 274
Line 16 (15:22:53):: RSS Buffer = HTTP/1.1 404 %2Fespn%2Frss%2Fnews+Not+Found$0D$0ADate: Wed, 15 Apr 2009 14:22:51 GMT$0D$0AServer: Jetty/4.2.x (VxWorks/WIND ve
Line 17 (15:22:53):: RSS Buffer = ews+Not+Found</title>$0A<body>$0A<h2>HTTP ERROR: 404 %2Fespn%2Frss%2Fnews+Not+Found</h2>$0A<p>RequestURI=/espn/rss/news</p>$0A
Line 18 (15:22:53):: CIpEvent::OffLine 0:8:1
I have tried the GET statement with the full url of http://sports.espn.com/espn/rss/news and as below with the resource
DEFINE_FUNCTION CHAR fnConnectRSS() { IF (nESPNDebug) { SEND_STRING 0,"'Time ',Time,' - Updating ESPN RSS!',ITOA(__LINE__),'>',crlf" } IP_CLIENT_OPEN (dvESPN.Port,'http://sports.espn.go.com',80,1) //ok for rss/xml and html // RETURN TRUE } DEFINE_FUNCTION CHAR fnGetRSS() { IF (nESPNDebug) { SEND_STRING 0, "'RSS Connected! line-<',ITOA(__LINE__),'>',crlf" } SEND_STRING dvESPN, "'GET /espn/rss/news',' HTTP/1.0', crlf,'Connection: Close',crlf,crlf" SEND_STRING dvESPN,"'Host: http://sports.espn.go.com',crlf" // ok for rss/xml and html SEND_STRING dvESPN,"crlf" IF (nESPNDebug) { SEND_STRING 0, "'ESPN RSS Get Request Sent: line -<', ITOA(__LINE__),'>',crlf" } RETURN TRUE }
Line 1 (15:20:20):: Refresh Sent
Line 2 (15:20:20):: Time 14:20:19 - Updating ESPN RSS!33>$0D$0A
Line 3 (15:20:20):: Memory Available = 35937440 <57368>
Line 4 (15:22:50):: Connected Successfully
Line 5 (15:22:50):: CIpEvent::OnLine 0:8:1
Line 6 (15:22:50):: RSS Connected! line-<44>$0D$0A
Line 7 (15:22:50):: ESPN RSS Get Request Sent: line -<53>$0D$0A
Line 8 (15:22:52):: Memory Available = 35855184 <82256>
Line 9 (15:22:52):: 14:22:51.699 EVENT Started HttpContext[/]
Line 10 (15:22:52):: Memory Available = 35823376 <31808>
Line 11 (15:22:53):: Exiting TCP Read thread - closing this socket for local port 8
Line 12 (15:22:53):: Memory Available = 35775576 <47800>
Line 13 (15:22:53):: No RSS captured:491 bytes from server! line-<120>
Line 14 (15:22:53):: Not sent to Parse
Line 15 (15:22:53):: SendString 0:0:0 too long 283 truncated to 274
Line 16 (15:22:53):: RSS Buffer = HTTP/1.1 404 %2Fespn%2Frss%2Fnews+Not+Found$0D$0ADate: Wed, 15 Apr 2009 14:22:51 GMT$0D$0AServer: Jetty/4.2.x (VxWorks/WIND ve
Line 17 (15:22:53):: RSS Buffer = ews+Not+Found</title>$0A<body>$0A<h2>HTTP ERROR: 404 %2Fespn%2Frss%2Fnews+Not+Found</h2>$0A<p>RequestURI=/espn/rss/news</p>$0A
Line 18 (15:22:53):: CIpEvent::OffLine 0:8:1
0
Comments
You need to ditch the http colon whack whack so try changing this:
To this:
The only SEND_STRING dvESPN you need is your first one:
I don?t think that?s true. The GET the way he has it should return whatever the default file is which in this case should be the RSS data.
Actually that may not be true since mncchartier put 'Connection: Close' in the 1st send_string. The original, original code didn't have that in there.