Skip to content

rohit-ghadge/Postman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 

Repository files navigation

Postman Request different optoins

Pass data inside Header

Get

Controller

  // Check Token is Valid or Not
    @Override
    protected void doFilterInternal(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, FilterChain filterChain) throws       ServletException, IOException 
    {
    	// Header Key Muse be = "Authorization"
        String authorization = httpServletRequest.getHeader("Authorization");
        String token = null;
        String userName = null;

        // Check Header Value start with "Bearer "
        if(null != authorization && authorization.startsWith("Bearer "))
        {
            token = authorization.substring(7);
            userName = jwtUtility.getUsernameFromToken(token);
        }

Pass data inside Body

Get

Controller

     @PostMapping("/flight/book/verify")
    public String showVerifyBookingPageResult(@RequestParam("flightId") long flightId,
                                              @RequestParam("passengerId") long passengerId,
                                              Model model)
    {

        Flight flight = flightService.getFlightById(flightId);
    }	

Pass data inside Params

Get

Controller

public class TestController 
{
    private final ServerServiceImpl serverService;

    @PostMapping("/save")
    public ResponseEntity<Response> saveServer(@RequestBody @Valid Server server) 
    {
         serverService.create(server));
    }
}

Releases

No releases published

Packages

No packages published