pike.git / lib / modules / Web.pmod / Api.pmod / Api.pike

version» Context lines:

pike.git/lib/modules/Web.pmod/Api.pmod/Api.pike:24:   protected constant ACCESS_TOKEN_PARAM_NAME = "access_token";      //! If @expr{1@} @[Standards.JSON.decode_utf8()] will be used when JSON data   //! is decoded.   protected constant DECODE_UTF8 = 0;      //! If @expr{1@} @[Standards.JSON.decode_utf8()] will be used when JSON data   //! is decoded.   public int(0..1) utf8_decode = DECODE_UTF8;    + //! Request timeout in seconds. Only affects async queries. + public int(0..) http_request_timeout = 0; +    //! Typedef for the async callback method signature.   typedef function(mapping,Protocols.HTTP.Query:void) Callback;    - //! Typef for a parameter argument + //! Typedef for a parameter argument   typedef mapping|Web.Auth.Params ParamsArg;      //! Authorization object.   //!   //! @seealso   //! @[Web.Auth.OAuth2]   protected Web.Auth.OAuth2.Client _auth;      //! Authentication class to use   protected constant AuthClass = Web.Auth.OAuth2.Client;
pike.git/lib/modules/Web.pmod/Api.pmod/Api.pike:244:    if (!data) data = (string) p;    params = 0;    }    else {    params = (mapping) p;    }       //Request req;    Protocols.HTTP.Query req = Protocols.HTTP.Query();    +  if (http_request_timeout) { +  req->timeout = http_request_timeout; +  } +    #ifdef SOCIAL_REQUEST_DEBUG    TRACE("\n> Request: %s %s?%s\n", http_method, api_method, (string) p);    if (data) TRACE("> data: %s\n", data);   #endif       if (cb) {    req->set_callbacks(    lambda (Protocols.HTTP.Query qq, mixed ... args) {    if (qq->status == 200) {    cb(handle_response(qq), qq);