HTTPie How to Set Null Value

To set null value in HTTPie, use the := operator, instead of the = operator:

http POST localhost:8000/ foo:=null

This will send the following payload with a null value:

{
    "foo": null
}

If you use the = operator, like foo=null, it will send a string instead of a null value:

http POST localhost:8000/ foo=null

{
    "foo": "null"
}

Also, foo= will send an empty string:

http POST localhost:8000/ foo=

{
    "foo": ""
}

Comments

Add Comment

Name

Email

Comment

Are you human? * three = 3