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

Add JSON support to RequestBuilder #2

Closed
seanmonstar opened this issue Oct 16, 2016 · 1 comment
Closed

Add JSON support to RequestBuilder #2

seanmonstar opened this issue Oct 16, 2016 · 1 comment

Comments

@seanmonstar
Copy link
Owner

Using serde/serde_json:

// on RequestBuilder
fn json<T: Serializable>(mut self, json: T) -> Self {
    // sets Content-Type to json
    // sets body to serialized json bytes
}

Would allow:

reqwest::post(url)
    .json(SomeSerializableThingy::new())
    .send()
@seanmonstar seanmonstar changed the title Add json support to RequestBuilder Add JSON support to RequestBuilder Oct 16, 2016
@seanmonstar
Copy link
Owner Author

This has been added. It could use some more documentation.

repi pushed a commit to EmbarkStudios/reqwest that referenced this issue Dec 20, 2019
repi pushed a commit to EmbarkStudios/reqwest that referenced this issue Dec 20, 2019
repi pushed a commit to EmbarkStudios/reqwest that referenced this issue Dec 20, 2019
gsollazzo referenced this issue in AIDEM-Technologies/reqwest Jul 18, 2022
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

No branches or pull requests

1 participant