Postman can't send post request to server and server detecting it as get request instead of post

Postman can't send post request to server and server detecting it as get request instead of post



Having issue in postman can't send post request to the server.
So I have


@GetMapping("/id")
public blablabla (@PathVariable long id )

@PostMapping("/scan")
public blablablabla()



Somehow when I send post request for /scan via postman it returns


/scan


Failed to convert value of type 'java.lang.String' to required type 'java.lang.Long';
nested exception is java.lang.NumberFormatException: For input string: "scan



But it works fine in my android application.
Is this postman issue?



Thank you






you have to define the content type in postman tool before sending any request. Refer the following link medium.com/aubergine-solutions/…

– Suresh
Sep 12 '18 at 4:32







I've got the problem. I already defined the content type. But I send http request to my https server. That's the problem. Thank you for your support @Suresh

– Michael Wijaya
Sep 12 '18 at 4:53




1 Answer
1



I've got the answer..
In postman, I send http request to my https server.
So it's redirecting it making it a GET request instead of my POST request.






github.com/postmanlabs/postman-app-support/issues/450

– Michael Wijaya
Sep 12 '18 at 5:28



Thanks for contributing an answer to Stack Overflow!



But avoid



To learn more, see our tips on writing great answers.



Required, but never shown



Required, but never shown




By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

PHP code is not being executed, instead code shows on the page

Administrative divisions of China

Cardinality of the set of algorithms