http:get-text() return value

Bug #1039990 reported by Xiang Gao
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
New
Low
Federico Cavalieri

Bug Description

when I called http:get-text("http://127.0.0.1:8080/default/cities.txt"), it returned <response xmlns="http://expath.org/ns/http-client" status="503" message="Service Temporarily Unavailable">, but it should return the url does not exist, the correct url is http://127.0.0.1:8080/cities.txt

Changed in zorba:
importance: Undecided → Low
Changed in zorba:
assignee: nobody → Paul J. Lucas (paul-lucas)
Changed in zorba:
assignee: Paul J. Lucas (paul-lucas) → Federico Cavalieri (fcavalieri)
Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Tested with both the old and new http module.
import module namespace http2 = "http://zorba.io/modules/http-client";
import module namespace http = "http://www.zorba-xquery.com/modules/http-client";
http:get-text("http://127.0.0.1:8080/default/cities.txt"),
http2:get-text("http://127.0.0.1:8080/default/cities.txt")

On my machine they return the correct answer:

<response xmlns="http://expath.org/ns/http-client" status="404" message="Not Found"><header name="Date" value="Fri, 21 Jun 2013 04:03:00 GMT"/><header name="Server" value="Apache/2.2.22 (Ubuntu)"/><header name="Vary" value="Accept-Encoding"/><header name="Content-Length" value="293"/><header name="Content-Type" value="text/html; charset=iso-8859-1"/><body media-type="text/html"/></response>&lt;!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"&gt;
&lt;html&gt;&lt;head&gt;
&lt;title&gt;404 Not Found&lt;/title&gt;
&lt;/head&gt;&lt;body&gt;
&lt;h1&gt;Not Found&lt;/h1&gt;
&lt;p&gt;The requested URL /default/cities.txt was not found on this server.&lt;/p&gt;
&lt;hr&gt;
&lt;address&gt;Apache/2.2.22 (Ubuntu) Server at 127.0.0.1 Port 8080&lt;/address&gt;
&lt;/body&gt;&lt;/html&gt;,
{ "status" : 404, "message" : "Not Found", "body" : { "media-type" : "text/html", "content" : "<!DOCTYPE HTML PUBLIC \"-//IETF//DTD HTML 2.0//EN\">\n<html><head>\n<title>404 Not Found</title>\n</head><body>\n<h1>Not Found</h1>\n<p>The requested URL /default/cities.txt was not found on this server.</p>\n<hr>\n<address>Apache/2.2.22 (Ubuntu) Server at 127.0.0.1 Port 8080</address>\n</body></html>\n" }, "headers" : { "Content-Length" : "293", "Content-Type" : "text/html; charset=iso-8859-1", "Date" : "Fri, 21 Jun 2013 04:00:51 GMT", "Server" : "Apache/2.2.22 (Ubuntu)", "Vary" : "Accept-Encoding" } }

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers