FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

v2.0.0 by s4cha · Pull Request #66 · freshOS/Networking · GitHub

v2.0.0 - #66

Open
s4cha wants to merge 12 commits into
masterfrom
simplify
Open

s4cha wants to merge 12 commits into
masterfrom
simplify

Conversation

s4cha commented Nov 16, 2023
edited
Loading

Copy link
Copy Markdown
Member
  • 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 ]))

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL