Jose Cabrera Zuniga
Jose Cabrera Zuniga

Reputation: 2613

wrong syntax at http parameter values

The next hyperlink is supposed to give me the users with ids 001 and 002.

 http://localhost:9000/users?myIds=001;002

Is there a problem with the semicolon? the controller is showing receiving only 001 but not 002.

Thanks

Upvotes: 0

Views: 19

Answers (1)

Obsidian Age
Obsidian Age

Reputation: 42304

You can't pass multiple values into a single GET parameter; you have to separate them out using an ampersand (&):

http://localhost:9000/users?id1=001&id2=002

Then you can access the IDs with id1 and id2 respectively.

If you specifically need to pass a string with a semicolon as a GET parameter, you need to use the HTML entity %3B instead:

http://localhost:9000/users?id1=001%3B002

Upvotes: 1

Related Questions