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 serialization for JSON and form bodies in post #4764

Merged
merged 3 commits into from
Mar 7, 2022
Merged

Add serialization for JSON and form bodies in post #4764

merged 3 commits into from
Mar 7, 2022

Conversation

wingertge
Copy link
Contributor

Description

Allows for passing JSON payloads and form data in the shape of a record or a list of key value pairs (only for forms to allow duplicates). Existing behaviour is preserved as it previously only accepted strings or binary data and it parses --content-type to distinguish between JSON and form bodies.

Examples

post -t application/json url.com { test: abcd }
post -t application/x-www-form-urlencoded [ test abcd test efgh ]

Tests

Make sure you've run and fixed any issues with these commands:

  • cargo fmt --all -- --check to check standard code formatting (cargo fmt --all applies these changes)
  • cargo clippy --all --all-features -- -D warnings -D clippy::unwrap_used -A clippy::needless_collect to check that you're using the standard code style
  • cargo build; cargo test --all --all-features to check that all the tests pass

@fdncred
Copy link
Collaborator

fdncred commented Mar 7, 2022

Thanks!

@fdncred fdncred merged commit 0a95bc7 into nushell:main Mar 7, 2022
@wingertge wingertge deleted the post-serialize branch March 7, 2022 16:57
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.

None yet

2 participants