Networking icon indicating copy to clipboard operation
Networking copied to clipboard

v2.0.0

Open s4cha opened this issue 2 years ago • 0 comments

  • Adds support for Encodable body.
  • Renames POST, PUT, PATCH params to body and make parameter encoding explicit (urlEncoded, json, .multipart`)
  • Simplify multipart usage via samebody param.
  • Reorganize folder structure, group methods per Http verb (Get, Post, Put, Patch)

Code

try await client.post("/posts/1", params: ["liked" : true ])
// becomes
try await client.post("/posts/1", body: .urlEncoded(["liked" : true ]))
client.parameterEncoding = .json
try await client.post("/posts/1", params: ["liked" : true ])
// becomes
try await client.post("/posts/1", body: .json(["liked" : true ]))

s4cha avatar Nov 16 '23 01:11 s4cha