Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 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!
- Host: GitHub
- URL: https://github.com/ParableHealth/URLRequestBuilder
- Owner: ParableHealth
- License: mit
- Created: 2022-06-02T11:58:44.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-20T15:54:20.000Z (almost 2 years ago)
- Last Synced: 2024-07-03T01:41:08.541Z (6 months ago)
- Language: Swift
- Homepage: https://medium.com/parable-engineering/building-a-reusable-system-for-complex-url-requests-with-swift-b385ba5fafe2
- Size: 11.7 KB
- Stars: 25
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ios - URLRequestBuilder
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)
```