File tree Expand file tree Collapse file tree
AndroidAnnotations/androidannotations-api/src/main/java/org/androidannotations/annotations/rest Expand file tree Collapse file tree Original file line number Diff line number Diff line change 136136 *
137137 * </p>
138138 *
139+ * <h1>RequestFactory</h1>
140+ * <p>
141+ * You can use your own request factory if you want to customize how requests
142+ * are created. The {@link #requestFactory()} parameter lets you define the
143+ * {@link org.springframework.http.client.ClientHttpRequestFactory
144+ * ClientHttpRequestFactory}.
145+ * </p>
146+ *
147+ * <p>
148+ * You can inject {@link org.androidannotations.annotations.EBean EBean} request
149+ * factories just like as interceptors.
150+ * </p>
151+ * <blockquote>
152+ *
153+ * <b>Example :</b>
154+ *
155+ * <pre>
156+ * @Rest(converters = MappingJacksonHttpMessageConverter.class, <b>requestFactory</b> = MyRequestFactory.class)
157+ * public interface MyRestClient {
158+ *
159+ * @Get("/events")
160+ * EventList getEvents();
161+ * }
162+ *
163+ * public class MyRequestFactory implements ClientHttpRequestFactory {
164+ *
165+ * @Override
166+ * public ClientHttpRequest createRequest(URI uri, HttpMethod httpMethod) throws IOException {
167+ * // create and return the request
168+ * }
169+ * }
170+ * </pre>
171+ *
172+ * </blockquote>
139173 *
140174 * <h1>Magic methods</h1>
141175 * <p>
235269 Class <?>[] interceptors () default {};
236270
237271 /**
238- * TODO .
272+ * The request factory class which is used to create the HTTP requests .
239273 *
240- * @return TODO
274+ * @return the request factory class
241275 */
242276 Class <?> requestFactory () default Void .class ;
243277}
You can’t perform that action at this time.
0 commit comments