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
letrequest=Request.get("https://jsonplaceholder.typicode.com/posts/1")
// Make a call
Malibu.request(request).validate().toJsonDictionary().then({ dictionary ->Postinprint(dictionary)returntryPost.init(object: dictionary)}).done({ posts in
// Handle response data
print(post)}).fail({ error in
// Handle errors
print(error)}).always({ _ in
// Hide progress bar
})
but when I define the API like network instance which named jsonPlaceholder. I don't any response, error, log. Nothing printed. No breakpoint entered to done, fail, or then.
enumJSONPlaceholderAPI:RequestConvertible{case getPost(id:String)staticvarbaseUrl:URLStringConvertible?="https://jsonplaceholder.typicode.com/"staticvarheaders:[String:String]=[:]publicvarrequest:Request{switchself{case.getPost(let id):returnRequest.get("posts/\(id)")}}}letjsonPlaceholder=Networking<JSONPlaceholderAPI>()
jsonPlaceholder.request(.getPost(id:"1")).validate().toJsonDictionary().then({ dictionary ->Postinprint(dictionary)returntryPost.init(object: dictionary)}).done({ posts in
// Handle response data
print(posts)}).fail({ error in
// Handle errors
print(error)}).always({ _ in
// Hide progress bar
})
The text was updated successfully, but these errors were encountered:
I've got response from the following code
but when I define the API like network instance which named jsonPlaceholder. I don't any response, error, log. Nothing printed. No breakpoint entered to done, fail, or then.
The text was updated successfully, but these errors were encountered: