Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.0.0 #66

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open

v2.0.0 #66

wants to merge 12 commits into from

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