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

Formalize @ suffix for all operators #1225

Merged
merged 3 commits into from
Dec 23, 2021

Conversation

isidentical
Copy link
Contributor

Resolves #964

Copy link
Member

@jkbrzt jkbrzt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good 👍🏻
Docs need some tweaks 📓

docs/README.md Outdated Show resolved Hide resolved
docs/README.md Outdated Show resolved Hide resolved
docs/README.md Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Dec 9, 2021

Codecov Report

Merging #1225 (9671bed) into master (4d7d6b6) will decrease coverage by 0.54%.
The diff coverage is 94.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1225      +/-   ##
==========================================
- Coverage   97.28%   96.74%   -0.55%     
==========================================
  Files          67       81      +14     
  Lines        4235     5431    +1196     
==========================================
+ Hits         4120     5254    +1134     
- Misses        115      177      +62     
Impacted Files Coverage Δ
tests/test_binary.py 100.00% <ø> (ø)
httpie/compat.py 31.11% <27.90%> (-68.89%) ⬇️
tests/conftest.py 77.14% <45.45%> (-9.82%) ⬇️
tests/test_ssl.py 91.01% <66.66%> (-3.93%) ⬇️
httpie/manager/__main__.py 82.35% <82.35%> (ø)
httpie/models.py 94.73% <83.33%> (-2.64%) ⬇️
httpie/output/formatters/colors.py 92.66% <88.88%> (-0.92%) ⬇️
httpie/manager/core.py 92.85% <92.85%> (ø)
httpie/manager/plugins.py 93.39% <93.39%> (ø)
httpie/plugins/manager.py 97.14% <94.44%> (+5.25%) ⬆️
... and 60 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8fe1f08...9671bed. Read the comment docs.

@isidentical
Copy link
Contributor Author

@jakubroztocil please re-review, I've tried to address your suggestions and make it a bit more simple.

docs/README.md Outdated
$ http PUT pie.dev/put \
X-Date:today \ # Header
token==secret \ # Query parameter
name=John \ # String (default)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

String (default) doesn’t explain what it does

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The space before the comments don’t need to be to so big

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps

Suggested change
name=John \ # String (default)
name=John \ # String Data (JSON or Form)

Copy link
Member

@jkbrzt jkbrzt Dec 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The table below describes the concepts so the labels should be consistent with that. This is a data field.

docs/README.md Outdated
$ http PUT pie.dev/put \
X-Date:today \ # Header
token==secret \ # Query parameter
name=John \ # String (default)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The space before the comments don’t need to be to so big

docs/README.md Outdated
$ http POST pie.dev/post \
X-Data:@files/text.txt # Read a header from a file
token==@files/text.txt # Read a query parameter from a file
name=@files/text.txt # Read a string from a file
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, "string" says nothing about how it’s used

docs/README.md Outdated
@@ -871,6 +904,14 @@ Host: <taken-from-URL>

Any of these can be overwritten and some of them unset (see below).

### Reading headers from a file

You can read headers from a file by using the `:@` operator. This would also effectively strip the newlines from the end.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back link to the section dedicated to the file operators

docs/README.md Outdated
@@ -518,6 +518,12 @@ $ http https://api.github.com/search/repositories q==httpie per_page==1
GET /search/repositories?q=httpie&per_page=1 HTTP/1.1
```

You can even retrieve the `value` from a file by using the `param==@file` syntax. This would also effectively strip the newlines from the end.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Back link to the section dedicated to the file operators

docs/README.md Outdated
You can read headers from a file by using the `:@` operator. This would also effectively strip the newlines from the end.

```bash
$ http pie.dev/headers :@files/text.txt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing header name

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.

Support header values read from file ?
3 participants