Swiftpack.co - Package - dduan/Just

Supported Flatform CocoaPods Carthage compatible Build Status

Just is a client-side HTTP library inspired by python-requests - HTTP for Humans.


Just lets you to the following effortlessly:

  • URL queries
  • custom headers
  • form (x-www-form-encoded) / JSON HTTP body
  • redirect control
  • multipart file upload along with form values.
  • basic/digest authentication
  • cookies
  • timeouts
  • synchronous / asynchronous requests
  • upload / download progress tracking for asynchronous requests
  • link headers
  • friendly accessible results


The simplest request with Just looks like this:

//  A simple get request

The next example shows how to upload a file along with some data:

//  talk to registration end point
let r = Just.post(
    data: ["username": "barryallen", "password":"ReverseF1ashSucks"],
    files: ["profile_photo": .url(fileURLWithPath:"flash.jpeg", nil)]

if r.ok { /* success! */ }

Here's the same example done asynchronously:

//  talk to registration end point
    data: ["username": "barryallen", "password":"ReverseF1ashSucks"],
    files: ["profile_photo": .url(fileURLWithPath:"flash.jpeg", nil)]
) { r in
    if r.ok { /* success! */ }

Read Getting Started on the web or in this playground to learn more!


Here are some ways to leverage Just.


Add https://github.com/dduan/Just.git the usual way.

Swift Package Manager

Add the following to your dependencies:

.package(url: "https://github.com/dduan/Just.git",  from: "0.8.0")

… and "Just" to your target dependencies.


Include the following in your Cartfile:

github "dduan/Just"

Just includes dynamic framework targets for both iOS and OS X.


The usual way:

platform :ios, '8.0'

target 'MyApp' do
  pod 'Just'


Drop Just.xcodeproj into your project navigator. Under the General tab of your project settings, use the plus sign to add Just.framework to Linked Framework and Libraries. Make sure to include the correct version for your target's platform.

It's also common to add Just as a git submodule to your projects repository:

cd path/to/your/project
git submodule add https://github.org/dduan/Just.git

Source File

Put Just.swift directly into your project. Alternately, put it in the Sources folder of a playground. (The latter makes a fun way to explore the web.)


Pull requests are welcome. Here are some tips for code contributors:

Work in Just.xcworkspace.

The tests for link headers relies on Github APIs, which has a low per-hour limit. To overcome this, you can edit the Xcode build schemes and add environment variables GITHUB_TOKEN. Learn more about personal tokens here.

For Xcode rebels, checkout Makefile.

HTML documentation pages are generated by literate programmin tool docco


MIT, see LICENSE.md.


Stars: 1243
Help us keep the lights on


Used By

Total: 0


0.8.0 - Jun 28, 2019

The Swift 5 support release.

0.7.1 - Sep 27, 2018


Fix code-signing issues reported in #112


Swift 4.2 support

0.7.0 - Sep 22, 2018

Swift 4.2 support.

0.6.0 - Apr 8, 2017

In this release, Just is update to Swift 3.1.

New Feature

In addition to Strings, the url parameter can now be an URL.


Minor changes to the APIs were made to follow the Swift API Design Guidelines

  1. URLQuery is renamed to urlQuery.
  2. HTTPMethods are now lowercase.

0.5.7 - Oct 29, 2016

Add data chunk for downloading progress (https://github.com/JustHTTP/Just/pull/53). Use the chunk property during a download progress to access the data.

Thank you, @divThis!