Branch: Tag:

2016-04-06

2016-04-06 12:09:41 by Pontus Östlund <ponost@roxen.com>

Web.Api.Api: If running async and the response isn't 200 the callback is now called anyway. If the response status is 301 or 302 the response headers is sent to the callback, otherwise 0 is send to the callback which is the same as if an error occured (this will happen if the request timed out or instance).

269:    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);
278:    Protocols.HTTP.do_async_method(http_method, api_method, params,    default_headers, req, data);    -  +     return 0;    }