Skip to content
Advertisement

Internal Server Error when making POST request using Rest Assured

I tried to make a POST request using POJO but getting “vHTTP/1.1 500 Internal Server Error”, could you please advise why? When I pass body as string it works fine, but the passing the bookingDetails will throw the error. I think something is not right with the BookingDates class but I’m not sure why.

JavaScript
JavaScript

Advertisement

Answer

You should pass the json serialized body of the BookingDetails object in your request body. You can use ObjectMapper for serializing the object:

JavaScript

And then pass it in your request body, also mentioning the contentType as JSON:

JavaScript
User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement