REST client cannot pass query param to JAX-RS

Answered

Hello,

I'm using IntelliJ's built in REST client to test my JAX-RS service:

@GET
public List<Candidate> getAllCandidates(@QueryParam("skillId") int skillId) {
System.out.println(skillId);
return candidateService.findBySkillId(skillId);
}

using the built in, when i query for: resources/api/candidate?skillId=9, the variable skillId is always set to 1 (as if it was not even sent in the request)

but if i use another tool with the same address, i good right results.

So how can i send GET parameters using the built in client?

 

Thank you.

 

0
2 comments

There is an open bug for POST requests: https://youtrack.jetbrains.com/issue/WEB-10265, but I don't see why it doesn't work with GET.

You are welcome to report a new bug at https://youtrack.jetbrains.com/issues/WEB and provide the setps to reproduce.

0
Avatar
Permanently deleted user

Sorry, it is working fine, 

I just realized that when i add the parameter to the path => "/api/candidate?skillId"

intelliJ automatically removes the parameter from the path, and adds it to "Request Parameters" list box.

I had dozen of the same parameters "skillId" being sent, and JAX-RS was taking the first one ...

 

Sorry, my bad...

0

Please sign in to leave a comment.