The search resource

Spring Data Rest exposes search resources for other methods in the repository. For example, the findUsersByNameUsingNamedParameters method is exposed at http://localhost:8080/users/search/findUsersByNameUsingNamedParameters?name=User%20Name%201. The following snippet shows the response of a Get request to the preceding URL:

    {      "_embedded": {          "users": [                     {                       "userid": "UserId1",                       "name": "User Name 1",                       "_links": {                         "self": {                                "href": "http://localhost:8080/users/1"                                },                          "user": {                                "href": "http://localhost:8080/users/1"                          },                         "todos": {                            "href":         "http://localhost:8080/users/1/todos"                          }                        }                     }                  ]               },     "_links": {      "self": {          "href":"http://localhost:8080/users/search/      findUsersByNameUsingNamedParameters?name=User%20Name%201"        }     }    }

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.