How to use a client for OpenTripPlanner router service to process RouteRequest and obtain RouteResponse?

27 Views Asked by At

Hello fellow developers,

I have set up an OpenTripPlanner (OTP) planner service on my server at xx.xx.xx.xx:xxxx/router/default/plan. The service allows me to send a GET request, including the RouteRequest, which I want to process. In return, the server provides the RouteResponse in JSON format. I am now looking for a client solution that can handle sending the RouteRequest to the API and conveniently give me the RouteResponse back as an answer from the API.

I understand that OpenTripPlanner is a vast open-source project, so there might be existing solutions for this, but I haven't been able to find one that suits my needs. I want to avoid manually converting the RouteRequest into a String that contains the GET request URL.

My tech stack involves Java for my project. Therefore, I am seeking assistance from experienced developers who might have dealt with a similar challenge in their Java projects and have knowledge of a suitable client library or method to achieve this seamlessly.

To summarize the question: How can I efficiently utilize a client to send a RouteRequest to the OpenTripPlanner API, obtain the RouteResponse, and process it internally in my Java project without resorting to manual URL conversion?

Any insights, suggestions, or code examples would be highly appreciated. Thank you in advance for your expertise!

0

There are 0 best solutions below