Last year I mentioned a swift library wrapping NSURLSession for basic HTTP requests called SwiftHTTP.
Here’s an open source Swift library called Just inspired by the python-requests library for http requests.
Just like the Python request library Just provides an extensive feature set for http request including:
– Cookie Support
– Redirection handling
– Custom headers
– Form data
– Authentication
– Synchronous and asynchronous requests
– Multipart file uploading
Here’s an example from the readme showing how one could make an asynchronous request with Just:
Just.post(
"http://justiceleauge.org/member/register",
data: ["username": "barryallen", "password":"ReverseF1ashSucks"],
files: ["profile_photo": .URL(fileURLWithPath:"flash.jpeg", nil)]
) { (r)
if (r.ok) { /* success! */ }
}
You can find Just on Github here.
A great library for http requests.
Original article: An Easy To Use Swift HTTP Requests Library Inspired By Python-Requests
©2015 iOS App Dev Libraries, Controls, Tutorials, Examples and Tools. All Rights Reserved.