Skip to content

Conversation

s4cha
Copy link
Member

@s4cha s4cha commented Nov 16, 2023

  • 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 ]))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant