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
{{ message }}
This repository has been archived by the owner on Dec 10, 2024. It is now read-only.
the signature for ajax call's json body is [String:AnyObject?], I need to post a JSON array to the server, how can I do that, will JustHTTP support that use case?
The text was updated successfully, but these errors were encountered:
@ruiyang2012 the signature is [String:AnyObject]?, different from what you posted.
Unfortunately, there's no convenient way to send an JSON array. The requestBody parameter allows you to construct the request body directly, so you can send your JSON array this way:
if let body =try?NSJSONSerialization.dataWithJSONObject([1,2,3], options:NSJSONWritingOptions(rawValue:0)){Just.post("http://httpbin.org/post", headers:["content-type":"application/json"], requestBody: body)}
There might be a case to change the type of json here. I'll need to see how common the use case such as yours is.
the signature for ajax call's json body is [String:AnyObject?], I need to post a JSON array to the server, how can I do that, will JustHTTP support that use case?
The text was updated successfully, but these errors were encountered: