We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Encoding MyModel to JSONObject using:
MyModel
JSONObject
let itemJSON = try Cheetah.JSONEncoder().encode(items)
If you now would like to use itemJSON as body for vapors client:
itemJSON
let result = try client.put(uri: String, query: [String : NodeRepresentable], headers: [HeaderKey : String], body: BodyRepresentable?, through: [Middleware])
you would have to do do something like:
let result = try client.put(uri, ["Content-Type": "application/json"], itemJSON.makeJSON().makeBody())
as JSONObject is not conforming to BodyRepresentable, you have to call makeJSON() on the already created JSONObject
BodyRepresentable
makeJSON()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Encoding
MyModel
toJSONObject
using:If you now would like to use
itemJSON
as body for vapors client:you would have to do do something like:
as
JSONObject
is not conforming toBodyRepresentable
, you have to callmakeJSON()
on the already createdJSONObject
The text was updated successfully, but these errors were encountered: