A corresponding parameter must be annotated with using the same string.
A replacement block is an alphanumeric string surrounded by. URL ManipulationĪ request URL can be updated dynamically using replacement blocks and parameters on the method. can also specify query parameters in the URL. The relative URL of the resource is specified in the annotation. There are eight built-in annotations: HTTP, GET, POST, PUT, PATCH, DELETE, OPTIONS and HEAD. Request MethodĮvery method must have an HTTP annotation that provides the request method and relative URL. Object conversion to request body (e.g., JSON, protocol buffers)Īnnotations on the interface methods and its parameters indicate how a request will be handled.
Retrofit turns your HTTP API into a Java interface.