Latest 0.2.0
License MIT
Platforms ios 9.3

CI Status

Minimal networking is exactly what’s written on the tin; a simple, dependence free networking library that aims to streamline simple networking requests without any unnecessary bells and whistles.


MinimalNetworking is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'MinimalNetworking'


Using Minimal Networking is as simple as installing the pod (see Installation) and initialising an HttpClient. From there, you can access the get and post methods.

The get method is

let httpService = HttpService()
_ = httpService.get(url: "url_to_hit", 
                    responseContentType: ResponseContentType.json, 
                    additionalHeaders: ["Accept": "application/json"]) 
{ (networkResponse: NetworkResponse<ParsedServerData?>) in
    switch networkResponse {
    case .success(let parsedData, let response):
        //use your data
    case .failure(let error):
        //handle the error

Minimal Networking allows you to specify the expected response type of your data using the ResponseContentType enumeration. It then automatically parses the server response if it is a supported type (at the moment, only JSON is supported).

The post method is almost identical. The only difference is that it takes a body parameter of type POSTBodyEncodable, which must provide a String detailing how the class will be decoded into a bodyParam:

struct PostQuery: POSTBodyEncodable {
  //struct implementation details...

  var asFormUrlEncoded: String = "minimalNetworking=Awesome!"
_ = "", 
                    body: PostQuery(), 
                    responseContentType: ResponseContentType.json, 
                    additionalHeaders: ["Accept": "application/json"]) 
{     (networkResponse: NetworkResponse<PostResponse?>) in 
  //completion handler functionality

The parsed response is returned to the user into a simple enum, with structure:

public enum NetworkResponse<T> {
    case success(T, HTTPURLResponse)
    case failure(Error)

In the case of a success, you will return your parsed class, and the HTTPUrlResponse class. Otherwise, you will receive a failure message method with details on the error you have received.


To run the example project, clone the repo, and run pod install from the Example directory first.


MinimalNetworking requires iOS 9.3 or above. Update dem projects yo.


The Minimal Networking Pod is still in a pre-release state, and there are a number of features still planned for before full launch. These include:

  • Support for more request types
  • Providing functionality to automatically encode a class into a POST body
  • Better support for requests that do not expect data to be returned
  • and more!

Please check out the Github project tab for more information.


Firanus, [email protected]


MinimalNetworking is available under the MIT license. See the LICENSE file for more info.

Latest podspec

    "name": "MinimalNetworking",
    "version": "0.2.0",
    "summary": "A minimalist networking library for iOS projects.",
    "description": "A simple networking library for iOS that emphasises brevity. It's dependency free, andnuses a simple result enum to handle its (asynchronous) requests.",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "Firanus": "[email protected]"
    "source": {
        "git": "",
        "tag": "0.2.0"
    "platforms": {
        "ios": "9.3"
    "swift_version": "4.1",
    "source_files": "MinimalNetworking/Classes/**/*"

Pin It on Pinterest

Share This