cancel
cancel: (Call) -> ()Cancel it: one in flight completes with onFailure(call, "Canceled"), one not started yet fails so when it is enqueued.
okHttpClient:newCall(…)
http:get(…)
http:post(…)| Method | Returns | Description |
|---|---|---|
cancel() | () | Cancel it: one in flight completes with onFailure(call, "Canceled"), one not started yet fails so when it is enqueued. |
isCanceled() | boolean | Whether it was cancelled. |
isExecuted() | boolean | Whether it was enqueued. |
request() | Request | The request. |
clone() | Call | A new call for the same request, not yet started. |
enqueue(any) | () | Start the request; responseCallback:onResponse(call, response) or :onFailure(call, e) runs on the client thread when it finishes (a tab… |
| Method | Returns | Description |
|---|---|---|
HttpService.get | Call | GET url, then callback(response, nil) or callback(nil, message). Returns the call, for cancel(). |
HttpService.post | Call | POST url with body of contentType, then callback(response, err). |
OkHttpClient.newCall | Call | A call for request, not yet started: enqueue starts it. |
cancelcancel: (Call) -> ()Cancel it: one in flight completes with onFailure(call, "Canceled"), one not started yet fails so when it is enqueued.
isCanceledisCanceled: (Call) -> booleanWhether it was cancelled.
isExecutedisExecuted: (Call) -> booleanWhether it was enqueued.
requestrequest: (Call) -> RequestThe request.
cloneclone: (Call) -> CallA new call for the same request, not yet started.
enqueueenqueue: (Call, any) -> ()Start the request; responseCallback:onResponse(call, response) or :onFailure(call, e) runs on the client thread when it finishes (a table with the two methods). A call runs once: a second enqueue is IllegalStateException: Already Executed.