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
extensionURLRequest{mutatingfunc dataTaskPublish(method:String="GET", withBody body:Data?=nil)->URLSession.DataTaskPublisher{letheaders=["Content-Type":"application/json; charset=utf-8","cache-control":"no-cache",]
httpMethod = method
allHTTPHeaderFields = headers
if let body = body {
httpBody = body
}letsession=URLSession.shared
return session.dataTaskPublisher(for:self)}}
The text was updated successfully, but these errors were encountered:
Example Use Case
When needing to set headers for a request.
The text was updated successfully, but these errors were encountered: