This week's book giveaway is in the Artificial Intelligence forum.
We're giving away four copies of Pragmatic AI and have Noah Gift on-line!
See this thread for details.
Win a copy of Pragmatic AI this week in the Artificial Intelligence forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

Problem with RESTapi endpoint manipulation  RSS feed

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a dropwizard application to POST/GET query information. I have a `@POST` method that populates an arrayList with my query and its' 11 parameters. For brevity, I cut the example down to only show 3 parameters.

   

I can send a get request through ARC and it will return successful with a json representation of the query.

I run into issues when I try to make a `@GET` request on the specific `queryId` and return a specific parameter of it. As such,

   

On the rest client I make a get request to

I'm expecting that to return the action type of that specific `queryId`, but instead is returning null.
 
Saloon Keeper
Posts: 2022
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dj Marlins wrote:


The template in the @Path annotation only specifies only path parameter: queryId.

Did you mean have this?:

 
Dj Marlins
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:

Dj Marlins wrote:


The template in the @Path annotation only specifies only path parameter: queryId.

Did you mean have this?:



Yes I did mean to have that.
 
Dj Marlins
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I make a request like this:


It is returning the string output of just "action", how can I get it to return the action of the query I populated in the arrayList object?
 
Ron McLeod
Saloon Keeper
Posts: 2022
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dj Marlins wrote:... It is returning the string output of just "action" ...

What URI are you using to call the web service?

Dj Marlins wrote:... how can I get it to return the action of the query I populated in the arrayList object?

Where is the ArrayList?  I don't see one in the code that you posted.
 
Dj Marlins
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The URI I'm using is



I wish to have it return "encrypt".

Currently I have



Which when hitting that endpoint returns
 
Ron McLeod
Saloon Keeper
Posts: 2022
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well .. you are making a call which gets handled by this method:
Using this URI:
Which means the path parameters get set as follows:
    queryId = "b622d2c6-03b2-4488-9d5d-46814606e550"
    eventType = "eventType"
    action = "action"

And you are returning a String value of: "Get action parameter: " + action

And the client application is seeing:
Seems correct to me - why would you expect anything different?
 
Ron McLeod
Saloon Keeper
Posts: 2022
273
Android Angular Framework Eclipse IDE Java Linux MySQL Database Redhat TypeScript
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Dj Marlins wrote:


How are these two handlers related?
 
Dj Marlins
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

How are these two handlers related?

The top one is used to generate a query with the desired arguments, and I want to retrieve each argument in the query through individuals @GET requests.
 
Dj Marlins
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ron McLeod wrote:


How are these two handlers related?


The @POST method returns the query. So I have 10 separate @GET requests with corresponding endpoints to return each parameter within the query.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!