Get Updates By E-mail 

Article Written By:
Johann Dowa

An Easy To Use Swift HTTP Requests Library Inspired By Python-Requests

  •  
  •  
  •  
  •  
  •  

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:

// talk to registration end point
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.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments