• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Request Param in boolean how should I handle it in POSTMAN ?

 
Ranch Hand
Posts: 947
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am afraid my brain is not so agile I just can't wrap my head in this.

So, I was asked to produce another end point with the input parameters = boolean in Order class which has instance Variable Enum  status : APPROVED, DELIVERED AND PENDING.

In a put request, how do I make it work ?

Should I just use Postman to do a key value with status and approved

And then after creating a order for testing, I then entered the body said from APPROVED TO delivered ?

Will that work ?  Will Postman be able to read the key value and the body with the Approved changed to delivered concurrently ?

I am really not used to Postman testing so hope to have some hints on this.

Tks.



 
Bartender
Posts: 2266
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
PUT is for posting new resources or updating existing resource.
If you want to use Postman, you can add a JSON as a request body.
Or, you may be able to find some Postman tutorials.

Here are the reference:
https://spring.io/guides/tutorials/rest/
 
Marshal
Posts: 4088
554
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

tangara goh wrote:I was asked to produce another end point with the input parameters = boolean in Order class which has instance Variable Enum  status : APPROVED, DELIVERED AND PENDING.


Is the Order resource specified in the request or the response?
Is the boolean value part of the Order resource, or is it outside of the resource and used to indicate how the request should be processed, or maybe part of the response to indicate the outcome of the request?

tangara goh wrote:In a put request, how do I make it work ?


Generally a POST method is used to create a new resource, and a PUT method is used to update an existing resource (although PUT is sometimes used to create a new resource if the resource identifier is provided by the requestor).  Are you creating a new resource, or updating an existing resource?

tangara goh wrote:Should I just use Postman to do a key value with status and approved


Does key value mean that you would be putting information in the HTTP header (for the request and/or response), or do you mean a key/value pair in a JSON or other type of structure?

tangara goh wrote:Will Postman be able to read the key value and the body with the Approved changed to delivered concurrently ?


Postman really just takes your input, builds a HTTP request, sends the request to the server, receives the response, and then lightly parses and displays the received information.  The application data specified in a request or response can be included in the HTTP headers (normally metadata, not resource data) and/or the body.
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is there a way to pass boolean values in the Body(x-www-form-encoded) in Postman.
 
Ron McLeod
Marshal
Posts: 4088
554
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess you just select the request parameter format of x-www-form-urlencoded, and then fill-in the table with keys names and values.

Depending on how the boolean values need to be represented to the application, you might use no/yes, false/true, 0/1, etc.



This is what it would look like on the wire:
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic