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

version» Context lines:

pike.git/lib/modules/Web.pmod/Api.pmod/Api.pike:262: Inside #if defined(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);    } +  else if ((< 301, 302 >)[qq->status]) { +  cb(qq->headers, qq); +  } +  else { +  cb(0, qq); +  }    },    lambda (Protocols.HTTP.Query qq, mixed ... args) {    cb(0, qq);    }    );       Protocols.HTTP.do_async_method(http_method, api_method, params,    default_headers, req, data);    -  +     return 0;    }       req = Protocols.HTTP.do_method(http_method, api_method, params,    default_headers, req, data);    return req && handle_response(req);   }      private mixed handle_response(Protocols.HTTP.Query req)   {