let hermes = Hermes() // GET let queryParams = ["foo": "bar"] let resource = Resource(url: "https://httpbin.org/get", method: .get(queryParams), modelType: T.self) // POST let postDatas = ["foo": "bar"] let resource = try Resource(url: "https://httpbin.org/post", method: .post(JSONEncoder().encode(postDatas)), modelType: T.self) // PUT let postDatas = ["foo": "bar"] let resource = try Resource(url: "https://httpbin.org/put", method: .put(JSONEncoder().encode(postDatas)), modelType: T.self) // PATCH let postDatas = ["foo": "bar"] let resource = try Resource(url: "https://httpbin.org/patch", method: .patch(JSONEncoder().encode(postDatas)), modelType: T.self) // DELETE let resource = Resource(url: "https://httpbin.org/delete", method: .delete, modelType: T.self) // Handle response let response = try await hermes.load(resource)
Deleting the wiki page "Usage" cannot be undone. Continue?