-
-
Notifications
You must be signed in to change notification settings - Fork 5
Success codes
Ahmad K. Bawaneh edited this page Mar 16, 2020
·
3 revisions
By default status codes 200
,201
,202
,203
,204
are considered a success for all requests, if we need to change this behavior we can change this for a single request using the @SuccessCodes
annotation.
@RequestFactory
public interface MoviesService {
@Path("library/movies/:movieName")
@GET
Movie getMovieByName(@PathParam("movieName") String movieName);
@Path("library/movies")
@GET
List<Movie> listMovies();
@Path("library/movies/:name")
@PUT
@SuccessCodes({200})
void updateMovie(@beanParam @RequestBody Movie movie);
}
now updateMethod
will only be considered success if the response status code is 200
.
- Home
- Quick start
- Sharing clients
-
Configuration
- Locating resource classes
- Service root
- Resource root
- Http methods
- Service method path mapping
- Service path
- Query parameters
- Path parameters
- Header parameters
- Date format
- Request body
- Request and Response mapping
- Produces and Consumes
- Success codes
- Timeout and maximum retries
- With credentials
- Custom request URL
- Global interceptors
- Default failed response handler
- Interface inheritance
- Multipart form data