Skip to content
Browse files

[feature] apigenlib: Added timeout to POST XML functions.

  • Loading branch information...
1 parent 7f76c98 commit f3cb5cf8e68c10361ddbe2f28fb2a8f46bf0e416 @nrs135 nrs135 committed Feb 8, 2013
Showing with 12 additions and 2 deletions.
  1. +12 −2 lib/stdlib/apis/apigenlib/apigenlib.opa
View
14 lib/stdlib/apis/apigenlib/apigenlib.opa
@@ -296,8 +296,13 @@ module ApigenLib {
/**
* Make a HTTP POST on [path] at [base] with string [xmlns]
*/
- function POST_XML(ApigenLib.logpkg logpkg, base, path, options, auth, custom_headers, xmlns, parse_fun) {
+ function POST_XML(ApigenLib.logpkg logpkg, base, path, options, timeout, auth, custom_headers, xmlns, parse_fun) {
http_options = {WebClient.Post.default_options with mimetype:"text/xml", ~custom_headers, content:{some:xmlns}}
+ http_options =
+ match (timeout) {
+ case {none}: http_options;
+ case timeout_sec: {http_options with ~timeout_sec};
+ }
POST_GENERIC(logpkg, base, path, options, auth, http_options, parse_fun)
//headers = [("Content-Type","text/xml")|custom_headers]
//http_options = {WebClient.default_options with ~headers, content:{some:xmlns}}
@@ -307,10 +312,15 @@ module ApigenLib {
/**
* Make a HTTP POST on [path] at [base] with string [xmlns]
*/
- function POST_WBXML(ApigenLib.logpkg logpkg, base, path, options, auth, custom_headers, wbxml, parse_fun) {
+ function POST_WBXML(ApigenLib.logpkg logpkg, base, path, options, timeout, auth, custom_headers, wbxml, parse_fun) {
http_options = {WebClient.Post.default_options with mimetype:"application/vnd.ms-sync.wbxml",
~custom_headers,
content:{some:wbxml}}
+ http_options =
+ match (timeout) {
+ case {none}: http_options;
+ case timeout_sec: {http_options with ~timeout_sec};
+ }
POST_GENERIC(logpkg, base, path, options, auth, http_options, parse_fun)
//headers = [("Content-Type","application/vnd.ms-sync.wbxml")|custom_headers]
//http_options = {WebClient.default_options with ~headers, content:{some:wbxml}}

0 comments on commit f3cb5cf

Please sign in to comment.
Something went wrong with that request. Please try again.