How do I use Postman to send queries with body (in json format) and files (in multipart) format at the same time? I think I should use Postman->Body->Raw although I can’t find an example on the Web. Anyone can kindly teach me? Thank you! Answer In postman, set method type to POST. Then select Body -> form-data -> Enter your
Tag: rest
Mock test always stops at isEmpty checking and throw an exception
I’ve written test for update method in service layer and it always throws an exception “User with the this id is not found” and didn’t work. I’ve tried to add optional but it didn’t work too. Could you give me a little piece of advice please? What should I fix in my test? My testing method looks like: My test
Magnolia REST Endpoint for Categories
I understanding now, how the Magnolia works. I writing REST Endpoint for Magnolia Content App in Java. My Content App is Categories – App and it looks like this: My task is, to define a REST endpoint for the Categories app in Java, which delivers the subcategories based on a passed category name and displays them in a component. For
What are the best practices for calculating statistics in REST API applications
I am trying to make a service that will calculate statistics for each month. I did smth like this: But it takes a long time if there are lots of etries in the database. Are there any best practices for working with statistics in REST API applications? And also I’d like to know if it is a good way to
Google Cloud Appengine returns ‘404 Error’ when calling Spring Boot REST APIs
I have deployed a spring boot application to Google cloud appengine service. When I run the application locally using mvn appengine:run everything works fine and I’m able to send requests to REST APIs and get expected responses back. In fact when I deploy the application to appengine I can see the application logs which indicate that server is up and
proper curl command for delete with > one word as the parameter
I have a rest request like the following: the id is a String, and can have multiple words with spaces in between like I would like to construct a curl command that supports String with spaces, but I don’t know how. Below does not pick up second word. grateful for ideas. Thanks Answer The answer was provided by VGR. URLs
REST. Checking the type of incoming field
how can I check the field type of the incoming response to the REST request. For example, I receive an answer with the “pay” field:”1000″ I want to check that the incoming field, its value is of type int What verification methods are there? Answer You can use Rest Assured Say you have this endpoint: https://mocki.io/v1/0f2701f8-46ab-48b5-9584-7e58da29498d that returns: Then your
Get values by key from JSON Multi-dimensional Array
JSON: Code: Output: I’m only retrieving the first value How do I retrieve all name values from a nested JSON Array? Thanks in advance! Answer With your current implementation, you are getting JsonNode object and you are reading it’s name property, but you are not reading that property for it’s chlildren (inner objects). You have to query all nested objects
@RestControllerAdvice Stops Working Properly when using @ResponseStatus too
I am using RestControllerAdvice to return custom responses dependending on the type of exception that happened (they are all runtime exceptions), this was the first time that I used it today and it was a very weird experience because at testing with postman and local it worked perfectly, but when we deployed to Quality it just did not work, everytime
how to call class parameter inside the for loop?
Problem:Cannot call the class parameter inside the for loop statement Implementation:I need to call this class inorder my rest api list will function and will show all the data. Problem:Cannot call the class parameter inside the for loop statement Implementation:I need to call this class inorder my rest api list will function and will show all the data. Answer productEntity2