How to send custom object in httpie request

I am making a project that uses httpie. I was able to send primitive fields and an array as a request parameter. For example, let's say I have a variable named "age" which is an integer type, I can send that variable as a Query parameter, Form parameter, or Path parameter. If I want to send age as a Query parameter, I would write the following:

http -v -f POST 'localhost:8080/api/v1/public/users?age=20'

      

The problem is when I want to send an object of a non-primitive class. For example, I have a class named Name, which is the following:

public class Name {
  String first, middle, last;
}

      

Now for an object of this class, how can I send an object of class Name as a parameter in the httpie request. I tried a lot but didn't find a solution.

+3
httpie


source to share


No one has answered this question yet

Check out similar questions:

18
How do I print a request when using HTTPie?
13
Sending an attached JSON object using HTTPie
2
Sending raw body with httpie at http-prompt
2
Content-Type for single file in multipart / form-data with HTTPie
2
how to run httpie from script.py
2
How do I set the number of retries in httpie?
2
saving httpie output with colors in document
1
HTTPie does not recognize the second parameter of the GET request
1
HTTPie code generator
1
How do I send a POST request using HTTPie?



All Articles
Loading...
X
Show
Funny
Dev
Pics