3 Commits

Author SHA1 Message Date
Victor Bodinaud
479f95f415 📝Edit SPM repo url in README 2024-03-21 15:03:42 +01:00
Victor Bodinaud
b1f3f21c95 Add Put & Patch methods 2024-03-21 15:02:59 +01:00
Victor Bodinaud
743530ef50 Merge tag '1.1.0' into develop 2024-01-14 19:32:25 +01:00
2 changed files with 10 additions and 2 deletions

View File

@@ -17,5 +17,5 @@ You can use Swift Package Manager to integrate Hermes into your project. Add the
```swift
dependencies: [
.package(url: "https://github.com/yourusername/Hermes.git", from: "1.0.0")
.package(url: "https://git.mahtan-melwasul.com/Mahtan/Hermes.git", from: "1.0.0")
]

View File

@@ -32,6 +32,8 @@ extension NetworkError: LocalizedError {
public enum HTTPMethod {
case get([URLQueryItem])
case post(Data?)
case put(Data?)
case patch(Data?)
case delete
var name: String {
@@ -40,6 +42,10 @@ public enum HTTPMethod {
return "GET"
case .post:
return "POST"
case .put:
return "PUT"
case .patch:
return "PATCH"
case .delete:
return "DELETE"
}
@@ -88,7 +94,9 @@ public struct Hermes {
request = URLRequest(url: url)
case .post(let data):
case .post(let data),
.put(let data),
.patch(let data):
request.httpMethod = resource.method.name
request.httpBody = data