Merge lp:~zorba-coders/zorba/expath-http-on-json-http into lp:zorba/http-client-module

Proposed by Federico Cavalieri
Status: Merged
Merged at revision: 36
Proposed branch: lp:~zorba-coders/zorba/expath-http-on-json-http
Merge into: lp:zorba/http-client-module
Diff against target: 130 lines (+8/-55)
4 files modified
src/CMakeLists.txt (+0/-19)
src/http-client.xq (+8/-8)
src/org/CMakeLists.txt (+0/-14)
src/org/expath/CMakeLists.txt (+0/-14)
To merge this branch: bzr merge lp:~zorba-coders/zorba/expath-http-on-json-http
Reviewer Review Type Date Requested Status
Cezar Andrei Approve
Chris Hillery Approve
Review via email: mp+176996@code.launchpad.net

Commit message

Updated the expath http client to use the json http client

To post a comment you must log in.
Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Ready for review.
This is updates the expath http client to be based on the wrapper module introduced in lp:~zorba-coders/zorba/http-client-wrapper

The comments of the previous branch (outdated links, wrapper conversion module) have been addressed.

Revision history for this message
Federico Cavalieri (fcavalieri) wrote :

Apparently the Expath HTTP Client queries 2 and 3 fail on the zorba demo website
(http://zorbawebsite2.my28msec.com/html/demo)

This does not seem to depend on the latest http client merge which apparently is not there yet.
Is this a known problem?

37. By Federico Cavalieri

Small documentation improvements

Revision history for this message
Chris Hillery (ceejatec) :
review: Approve
Revision history for this message
Cezar Andrei (cezar-andrei) :
review: Approve
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :
Revision history for this message
Zorba Build Bot (zorba-buildbot) wrote :

Validation queue succeeded - proposal merged!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== removed file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2011-07-26 10:42:50 +0000
+++ src/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,19 +0,0 @@
1# Copyright 2006-2008 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15# all external module libraries are generated in the directory
16# of the corresponding .xq file
17MESSAGE(STATUS "Add org")
18ADD_SUBDIRECTORY(org)
19MESSAGE(STATUS "End modules")
200
=== renamed file 'src/org/expath/ns/CMakeLists.txt' => 'src/CMakeLists.txt'
=== renamed file 'src/org/expath/ns/http-client.xq' => 'src/http-client.xq'
--- src/org/expath/ns/http-client.xq 2013-06-15 19:39:40 +0000
+++ src/http-client.xq 2013-07-25 18:50:32 +0000
@@ -30,22 +30,22 @@
30 : <p>30 : <p>
31 : In general, both functions take a description of the HTTP request to make31 : In general, both functions take a description of the HTTP request to make
32 : as parameter, execute the request, and return a representation of the HTTP32 : as parameter, execute the request, and return a representation of the HTTP
33 : response. For instance, in the following code snippet, we fetch the blog feed from Zorba:33 : response. For instance, in the following code snippet, we fetch the Zorba
34 : home page:
34 : </p>35 : </p>
35 : <pre class="ace-static" ace-mode="xquery"><![CDATA[import module namespace http = "http://expath.org/ns/http-client";36 : <pre class="ace-static" ace-mode="xquery"><![CDATA[import module namespace http = "http://expath.org/ns/http-client";
36 : 37 :
37 : http:send-request(38 : http:send-request(
38 : <http:request href="http://www.zorba-xquery.com/blog/feed" method="get" />39 : <http:request href="http://zorba.io" method="get" />
39 : )40 : )
40 : ]]></pre>41 : ]]></pre>
41 : <p>You can try this example <a href="http://www.zorba-xquery.com/html/demo#GKnscDSYqVadJ+CQftvnRw+LUd0=">live</a>.</p>
42 : 42 :
43 : <p>43 : <p>
44 : The <code>http:send-request()</code> functions are declared as sequential. 44 : The <code>http:send-request()</code> functions are declared as sequential.
45 : Sequential functions are allowed to have side effects. For example, most probably,45 : Sequential functions are allowed to have side effects. For example, most probably,
46 : an HTTP POST request is a request that has side effects because it adds/changes46 : an HTTP POST request is a request that has side effects because it adds/changes
47 : a remote resource. Sequential functions are specified in the47 : a remote resource. Sequential functions are specified in the
48 : <a href="http://www.zorba-xquery.com/html/documentation/latest/zorba/scripting_tutorial">XQuery Scripting Extension</a>.48 : <a href="http://zorba.io/documentation/2.9/zorba/scripting_tutorial.html">XQuery Scripting Extension</a>.
49 : In contrast, the http:read() functions are not declared as sequential -49 : In contrast, the http:read() functions are not declared as sequential -
50 : they are declared as nondeterministic though, which50 : they are declared as nondeterministic though, which
51 : means that several calls may return different results.51 : means that several calls may return different results.
@@ -97,7 +97,7 @@
97 : <a href="http://expath.org/spec/http-client#d2e491">specification</a>.97 : <a href="http://expath.org/spec/http-client#d2e491">specification</a>.
98 : </p>98 : </p>
99 :99 :
100 : @author Markus Pilman100 : @author Federico Cavalieri, Markus Pilman
101 : @see <a href="http://www.w3.org/TR/xquery-3/#FunctionDeclns">XQuery 3.0: Function Declaration</a>101 : @see <a href="http://www.w3.org/TR/xquery-3/#FunctionDeclns">XQuery 3.0: Function Declaration</a>
102 : @library <a href="http://curl.haxx.se/">cURL Library</a>102 : @library <a href="http://curl.haxx.se/">cURL Library</a>
103 : @project EXPath/EXPath HTTP Client103 : @project EXPath/EXPath HTTP Client
@@ -105,7 +105,7 @@
105 :)105 :)
106module namespace http = "http://expath.org/ns/http-client";106module namespace http = "http://expath.org/ns/http-client";
107107
108import module namespace zorba-http = "http://www.zorba-xquery.com/modules/http-client";108import module namespace http-wrapper = "http://zorba.io/modules/http-client-wrapper";
109import module namespace err = "http://expath.org/ns/error";109import module namespace err = "http://expath.org/ns/error";
110110
111import module namespace tidy="http://www.zorba-xquery.com/modules/converters/html";111import module namespace tidy="http://www.zorba-xquery.com/modules/converters/html";
@@ -152,7 +152,7 @@
152 try 152 try
153 {153 {
154 {154 {
155 variable $result := zorba-http:send-request($request, $href, $bodies);155 variable $result := http-wrapper:http-sequential-request($request, $href, $bodies);
156 http:tidy-result($result, fn:data($request/@override-media-type))156 http:tidy-result($result, fn:data($request/@override-media-type))
157 }157 }
158 } catch XPTY0004 {158 } catch XPTY0004 {
@@ -223,4 +223,4 @@
223 tidy:parse($body)223 tidy:parse($body)
224 else224 else
225 $body225 $body
226}; 226};
227227
=== removed directory 'src/org'
=== removed file 'src/org/CMakeLists.txt'
--- src/org/CMakeLists.txt 2011-10-06 08:18:34 +0000
+++ src/org/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
1# Copyright 2006-2008 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14ADD_SUBDIRECTORY(expath)
150
=== removed directory 'src/org/expath'
=== removed file 'src/org/expath/CMakeLists.txt'
--- src/org/expath/CMakeLists.txt 2011-10-06 08:18:34 +0000
+++ src/org/expath/CMakeLists.txt 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
1# Copyright 2006-2008 The FLWOR Foundation.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14ADD_SUBDIRECTORY(ns)
150
=== removed directory 'src/org/expath/ns'

Subscribers

People subscribed via source and target branches

to all changes: