Networking
Networking copied to clipboard
v2.0.0
- Adds support for
Encodablebody. - Renames POST, PUT, PATCH
paramstobodyand make parameter encoding explicit (urlEncoded,json, .multipart`) - Simplify multipart usage via same
bodyparam. - 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 ]))