tut-rest icon indicating copy to clipboard operation
tut-rest copied to clipboard

Error: java.lang.IllegalArgumentException: Invalid character found in method name [] . HTTP method names must be tokens

Open AAdewunmi opened this issue 2 years ago • 1 comments

I had the same problem using Eclipse STS.

Screenshot 2022-11-15 at 11 11 16

Mozilla Error:

Screenshot 2022-11-15 at 11 11 01

Simple fix:

It has to do with using http//: instead of https//: e.g.

Employee API makes the following call:

$ curl -v localhost:8080/employees

or

$ curl -v https://localhost:8080/employees

Orders API makes the following call:

$ curl -v http://localhost:8080/orders

Essentially, swapping "http" with "https", when testing your API end points, will fix the problem.

😎

AAdewunmi avatar Nov 15 '22 12:11 AAdewunmi

Hi @AAdewunmi. What error do you get when you run the curl commands from a terminal or command prompt? The error I see is from Mozilla and Eclipse STS which puts another layer in between the request and the response. When I went through the tutorial it worked with the commands as is, but did not work with https.

robertmcnees avatar May 09 '24 12:05 robertmcnees

Hi @AAdewunmi. Have you had the chance to look into this further? I'll leave this issue open for a bit longer but will close it soon if I don't hear back. Let me know if the issue persists.

robertmcnees avatar Jul 09 '24 10:07 robertmcnees

Hi @robertmcnees, issue has been fixed, thanks.

AAdewunmi avatar Jul 09 '24 11:07 AAdewunmi