HTTPie: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
No edit summary
Line 6: Line 6:
{|
{|
| valign="top" |
| valign="top" |
<source lang="bash">
<syntaxhighlight lang="bash">
# post request body
# post request body
https academia.chorke.org/v1/collections\
time https academia.chorke.org/v1/collections\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  Content-Type:application/json\
  Content-Type:application/json\
Line 18: Line 18:
     "extendedProperties": {}
     "extendedProperties": {}
}'
}'
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
<source lang="bash">
<syntaxhighlight lang="bash">
# post request body
# post request body
https academia.chorke.org/v1/collections\
time https academia.chorke.org/v1/collections\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  Content-Type:application/json\
  Content-Type:application/json\
Line 33: Line 33:
     "extendedProperties": {}
     "extendedProperties": {}
}'
}'
</source>
</syntaxhighlight>


|-
|-
Line 40: Line 40:
|-
|-
| valign="top" |
| valign="top" |
<source lang="bash">
<syntaxhighlight lang="bash">
# put request body
# put request body
https PUT academia.chorke.org/v1/collections/1000\
time https PUT academia.chorke.org/v1/collections/1000\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  Content-Type:application/json\
  Content-Type:application/json\
Line 52: Line 52:
     "extendedProperties": {}
     "extendedProperties": {}
}'
}'
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
<source lang="bash">
<syntaxhighlight lang="bash">
# put request body
# put request body
https PUT academia.chorke.org/v1/collections/1000\
time https PUT academia.chorke.org/v1/collections/1000\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  Content-Type:application/json\
  Content-Type:application/json\
Line 67: Line 67:
     "extendedProperties": {}
     "extendedProperties": {}
}'
}'
</source>
</syntaxhighlight>


|-
|-
Line 74: Line 74:
|-
|-
| valign="top" |
| valign="top" |
<source lang="bash">
<syntaxhighlight lang="bash">
# show response body
# show response body
https academia.chorke.org/v1/collections\
time https academia.chorke.org/v1/collections\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  Content-Type:application/json\
  Content-Type:application/json\
Line 87: Line 87:
     "extendedProperties": {}
     "extendedProperties": {}
}'
}'
</source>
</syntaxhighlight>


| valign="top" |
| valign="top" |
<source lang="bash">
<syntaxhighlight lang="bash">
# show response body
# show response body
https academia.chorke.org/v1/collections\
time https academia.chorke.org/v1/collections\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
  Content-Type:application/json\
  Content-Type:application/json\
Line 103: Line 103:
     "extendedProperties": {}
     "extendedProperties": {}
}'
}'
</source>
</syntaxhighlight>


|-
|-

Revision as of 17:08, 19 April 2024

choco install httpie
brew  install httpie
snap  install httpie

Playground

# post request body
time https academia.chorke.org/v1/collections\
 x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
 Content-Type:application/json\
 <<< '{
    "code": "M",
    "name": "Male",
    "group": "gender",
    "properties": {},
    "extendedProperties": {}
}'
# post request body
time https academia.chorke.org/v1/collections\
 x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
 Content-Type:application/json\
 --raw '{
    "code": "M",
    "name": "Male",
    "group": "gender",
    "properties": {},
    "extendedProperties": {}
}'

# put request body
time https PUT academia.chorke.org/v1/collections/1000\
 x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
 Content-Type:application/json\
 <<< '{
    "code": "M",
    "name": "Male",
    "group": "gender",
    "properties": {},
    "extendedProperties": {}
}'
# put request body
time https PUT academia.chorke.org/v1/collections/1000\
 x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
 Content-Type:application/json\
 --raw '{
    "code": "M",
    "name": "Male",
    "group": "gender",
    "properties": {},
    "extendedProperties": {}
}'

# show response body
time https academia.chorke.org/v1/collections\
 x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
 Content-Type:application/json\
 -b\
 <<< '{
    "code": "M",
    "name": "Male",
    "group": "gender",
    "properties": {},
    "extendedProperties": {}
}'
# show response body
time https academia.chorke.org/v1/collections\
 x-auth-key:aeda11fd-14ea-44d0-aff6-e94bf6b78c1b\
 Content-Type:application/json\
 -b\
 --raw '{
    "code": "M",
    "name": "Male",
    "group": "gender",
    "properties": {},
    "extendedProperties": {}
}'

http https://cdn.chorke.org/bash/java/pull
http https://cdn.chorke.org/exec/cli/
http --version
http --help

References