GitPedia

RealHTTP

🌀swift async http client - fast, lightweight, type-safe

From immobiliare·Updated January 7, 2026·View on GitHub·

RealHTTP is a lightweight yet powerful async-based HTTP library made in Swift. This project aims to make an easy-to-use, effortless HTTP client based on all the best new Swift features. The project is written primarily in Swift, distributed under the MIT License license, first published in 2021. Key topics include: alamofire, api, async-await, http, http-client.

Latest release: 1.9.0
January 15, 2025View Changelog →
<p align="center"> <picture> <source media="(prefers-color-scheme: dark)" srcset="./Documentation/assets/realhttp-dark.png" width="350"> <img alt="logo-library" src="./Documentation/assets/realhttp-light.png" width="350"> </picture> </p>

Swift
Platform
Swift Package Manager
CocoaPods Compatible

RealHTTP is a lightweight yet powerful async-based HTTP library made in Swift.
This project aims to make an easy-to-use, effortless HTTP client based on all the best new Swift features.

What will you get?

Below is a simple HTTP call in RealHTTP.

swift
let todo = try await HTTPRequest("https://jsonplaceholder.typicode.com/todos/1") .fetch(Todo.self)

One line of code, including the automatic decode from JSON to object.

Of course, you can fully configure the request with many other parameters. Take a look here:

swift
let req = HTTPRequest { // Setup default params $0.url = URL(string: "https://.../login")! $0.method = .post $0.timeout = 15 // Setup some additional settings $0.redirectMode = redirect $0.maxRetries = 4 $0.headers = HTTPHeaders([ .init(name: .userAgent, value: myAgent), .init(name: "X-API-Experimental", value: "true") ]) // Setup URL query params & body $0.addQueryParameter(name: "full", value: "1") $0.addQueryParameter(name: "autosignout", value: "30") $0.body = .json(["username": username, "pwd": pwd]) } let _ = try await req.fetch()

The code is fully type-safe.

What about the stubber?

Integrated stubber is perfect to write your own test suite:

That's a simple stubber which return the original request as response:

swift
let echoStub = HTTPStubRequest().match(urlRegex: "*").stubEcho() HTTPStubber.shared.add(stub: echoStub) HTTPStubber.shared.enable()

Of course you can fully configure your stub with rules (regex, URI template and more):

swift
// This is a custom stubber for any post request. var stub = HTTPStubRequest() .stub(for: .post, { response in response.responseDelay = 5 response.headers = HTTPHeaders([ .contentType: HTTPContentType.bmp.rawValue, .contentLength: String(fileSize, ]) response.body = fileContent }) HTTPStubber.shared.add(stub: stub)

That's all!

Feature Highlights

RealHTTP offers lots of features and customization you can find in our extensive documentation and test suite.
Some of them are:

  • Async/Await native support
  • Requests queue built-in
  • Based upon native URLSession technology
  • Advanced retry mechanisms
  • Chainable & customizable response validators like Node's Express.js
  • Automatic Codable object encoding/decoding
  • Customizable decoding of objects

And for pro users:

  • Powerful integrated HTTP Stub for your mocks
  • Combine publisher adapter
  • URI templating system
  • Resumable download/uploads with progress tracking
  • Native Multipart Form Data support
  • Advanced URL connection metrics collector
  • SSL Pinning, Basic/Digest Auth
  • TSL Certificate & Public Key Pinning
  • cURL debugger

Documentation

RealHTTP provides an extensive documentation.

API Reference

RealHTTP is fully documented at source-code level. You'll get autocomplete with doc inside XCode for free; moreover you can read the full Apple's DoCC Documentation automatically generated thanks to Swift Package Index Project from here:

👉 API REFERENCE

Test Suite

RealHTTP has an extensive unit test suite covering many standard and edge cases, including request build, parameter encoding, queuing, and retries strategies.
See the XCTest suite inside Tests/RealHTTPTests folder.

Requirements

RealHTTP can be installed on any platform which supports:

  • iOS 13+, macOS Catalina+, watchOS 6+, tvOS 13+
  • Xcode 13.2+
  • Swift 5.5+

Installation

Swift Package Manager

Add it as a dependency in a Swift Package, and add it to your Package. Swift:

swift
dependencies: [ .package(url: "https://github.com/immobiliare/RealHTTP.git", from: "1.0.0") ]

And add it as a dependency of your target:

swift
targets: [ .target(name: "MyTarget", dependencies: [ .product(name: "https://github.com/immobiliare/RealHTTP.git", package: "RealHTTP") ]) ]

In Xcode 11+ you can also navigate to the File menu and choose Swift Packages -> Add Package Dependency..., then enter the repository URL and version details.

CocoaPods

RealHTTP can be installed with CocoaPods by adding pod 'RealHTTP' to your Podfile.

ruby
pod 'RealHTTP'

Powered Apps

The fantastic mobile team at ImmobiliareLabs created RealHTTP.
We are currently using RealHTTP in all of our products.

If you are using RealHTTP in your app drop us a message.

Support & Contribute

Made with ❤️ by ImmobiliareLabs & Contributors

We'd love for you to contribute to RealHTTP!
If you have questions about using RealHTTP, bugs, and enhancement, please feel free to reach out by opening a GitHub Issue.

<a href="http://labs.immobiliare.it"><img src="./Documentation/assets/immobiliarelabs.png" alt="ImmobiliareLabs" width="200"/></a>

Contributors

Showing top 9 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from immobiliare/RealHTTP via the GitHub API.Last fetched: 6/19/2026