Add table of contents and Installation instructions

This commit is contained in:
Ailton Vieira
2023-06-16 21:43:28 -03:00
parent 8710292b9d
commit 7f366445b1

View File

@@ -4,6 +4,7 @@
SwiftRequest is a lightweight, type-safe HTTP client for Swift, streamlining the construction and execution of HTTP requests.
[Overview](#overview) • [Installation](#installation) • [Supported HTTP Methods](#supported-http-methods) • [Parameters](#parameters) • [License](#license)
## Overview
SwiftRequest abstracts away the repetitive boilerplate code that's typically associated with setting up HTTP requests in Swift. It utilizes macros introduced in Swift 5.9, which can be associated with specific declarations to enhance and extend their functionality.
@@ -29,6 +30,30 @@ let quotes = try await service.getRandomQuotes(limit: 5)
let quote = try await service.getQuote(by: "69Ldsxcdm-")
```
## Installation
### Xcode
> It requires Xcode 15 or later.
In Xcode, go to `File > Add Package Dependency` and paste the repository URL:
```
https://github.com/ailtonvivaz/swift-request.git
```
### Swift Package Manager
In `Package.swift`:
```swift
dependencies: [
.package(url: "https://github.com/ailtonvivaz/swift-request.git", from: "0.1.0")
]
```
And then add the dependency to your targets.
## Supported HTTP Methods
SwiftRequest offers support for the following HTTP methods: