You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As part of the work to separate the request API from ServiceTask, a new ServiceRequest struct type will be addded to replace for ServiceTask's requesting building API.
Currently ServiceTask API conflates request building with response processing:
service
.POST("/brews")
.setFormParameters(["foo": "bar"])
.response { data, response in
// process response
}
.resume()
With the new request API, ServiceRequest and ServiceTask values can be created independently for greater flexibility.
// create a request
var request = service.request(.post, "/brews")
request.formParameters = ["foo": "bar"]
// spawn a task instance for sending the request and processing the response
service
.task(request: request)
.response { data, response in
// process response
}
.resume()
The text was updated successfully, but these errors were encountered:
As part of the work to separate the request API from
ServiceTask
, a newServiceRequest
struct type will be addded to replace forServiceTask
's requesting building API.Currently
ServiceTask
API conflates request building with response processing:With the new request API,
ServiceRequest
andServiceTask
values can be created independently for greater flexibility.The text was updated successfully, but these errors were encountered: