← Back to team overview

zorba-coders team mailing list archive

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

 

Federico Cavalieri has proposed merging lp:~zorba-coders/zorba/expath-http-on-json-http into lp:zorba/http-client-module.

Requested reviews:
  Cezar Andrei (cezar-andrei)
  Chris Hillery (ceejatec)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/expath-http-on-json-http/+merge/176996
-- 
https://code.launchpad.net/~zorba-coders/zorba/expath-http-on-json-http/+merge/176996
Your team Zorba Coders is subscribed to branch lp:zorba/http-client-module.
=== 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 @@
-# Copyright 2006-2008 The FLWOR Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-# all external module libraries are generated in the directory
-# of the corresponding .xq file
-MESSAGE(STATUS "Add org")
-ADD_SUBDIRECTORY(org)
-MESSAGE(STATUS "End modules")

=== 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 16:52:28 +0000
@@ -30,22 +30,23 @@
  : <p>
  : In general, both functions take a description of the HTTP request to make
  : as parameter, execute the request, and return a representation of the HTTP
- : response. For instance, in the following code snippet, we fetch the blog feed from Zorba:
+ : response. For instance, in the following code snippet, we fetch the Zorba
+ : home page:
  : </p>
- : <pre class="ace-static" ace-mode="xquery"><![CDATA[import module namespace http = "http://expath.org/ns/http-client";;
+ : <pre>
+ : import module namespace http = "http://expath.org/ns/http-client";;
  : 
  : http:send-request(
- :  <http:request href="http://www.zorba-xquery.com/blog/feed";  method="get" />
+ :  <http:request href="http://zorba.io"; method="get" />
  : )
- : ]]></pre>
- : <p>You can try this example <a href="http://www.zorba-xquery.com/html/demo#GKnscDSYqVadJ+CQftvnRw+LUd0=";>live</a>.</p>
+ : </pre>
  : 
  : <p>
  : The <code>http:send-request()</code> functions are declared as sequential. 
  : Sequential functions are allowed to have side effects. For example, most probably,
  : an HTTP POST request is a request that has side effects because it adds/changes
  : a remote resource. Sequential functions are specified in the
- : <a href="http://www.zorba-xquery.com/html/documentation/latest/zorba/scripting_tutorial";>XQuery Scripting Extension</a>.
+ : <a href="http://www.zorba.io/documentation/latest/zorba/scripting_tutorial.html";>XQuery Scripting Extension</a>.
  : In contrast, the http:read() functions are not declared as sequential -
  : they are declared as nondeterministic though, which
  : means that several calls may return different results.
@@ -97,7 +98,7 @@
  : <a href="http://expath.org/spec/http-client#d2e491";>specification</a>.
  : </p>
  :
- : @author Markus Pilman
+ : @author Federico Cavalieri, Markus Pilman
  : @see <a href="http://www.w3.org/TR/xquery-3/#FunctionDeclns";>XQuery 3.0: Function Declaration</a>
  : @library <a href="http://curl.haxx.se/";>cURL Library</a>
  : @project EXPath/EXPath HTTP Client
@@ -105,7 +106,7 @@
  :)
 module namespace http = "http://expath.org/ns/http-client";;
 
-import module namespace zorba-http = "http://www.zorba-xquery.com/modules/http-client";;
+import module namespace http-wrapper = "http://zorba.io/modules/http-client-wrapper";;
 import module namespace err = "http://expath.org/ns/error";;
 
 import module namespace tidy="http://www.zorba-xquery.com/modules/converters/html";;
@@ -152,7 +153,7 @@
   try 
   {
      {
-       variable $result := zorba-http:send-request($request, $href, $bodies);
+       variable $result := http-wrapper:http-sequential-request($request, $href, $bodies);
        http:tidy-result($result, fn:data($request/@override-media-type))
      }
   } catch XPTY0004 {
@@ -223,4 +224,4 @@
       tidy:parse($body)
     else
       $body
-};                          
+};

=== 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 @@
-# Copyright 2006-2008 The FLWOR Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-ADD_SUBDIRECTORY(expath)

=== 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 @@
-# Copyright 2006-2008 The FLWOR Foundation.
-# 
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-# 
-# http://www.apache.org/licenses/LICENSE-2.0
-# 
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-ADD_SUBDIRECTORY(ns)

=== removed directory 'src/org/expath/ns'

Follow ups