Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ParableHealth/URLRequestBuilder

Reusable system for complex URL requests with Swift. Deal with query items, HTTP headers, request body and more in an easy, declarative way. Check out our engineering blog to learn more!
https://github.com/ParableHealth/URLRequestBuilder

Last synced: about 2 months ago
JSON representation

Reusable system for complex URL requests with Swift. Deal with query items, HTTP headers, request body and more in an easy, declarative way. Check out our engineering blog to learn more!

Awesome Lists containing this project

README

        

# URLRequestBuilder

Deal with query items, HTTP headers, request body and more in an easy, declarative way

## Showcase

```swift
let urlRequest = try URLRequestBuilder(path: "users/submit")
.method(.post)
.jsonBody(user)
.contentType(.applicationJSON)
.accept(.applicationJSON)
.timeout(20)
.queryItem(name: "city", value: "San Francisco")
.header(name: "Auth-Token", value: authToken)
.makeRequest(withBaseURL: testURL)
```