Repository navigation
1.3.0
New features
HttpPoem, a new way to perform HTTP requests with even less code
HttpPoem allows you to perform HTTP request with an HttpPoet as a context.
poet.poem {
def todos = get '/todos', [author: 'au@thor.me']
post '/todos', [title: 'new post', author: 'me@myself.me']
}History: keep track of requests made
The history allows you to retrieve information about past requests/responses
def todos = poet.get "todos"
if (poet.history.last().isSuccessful()) {
process(todos)
} Multipart file requests
Added support of multipart requests
Example
poet.post("/upload-file", contentType: ContentType.MULTIPART_FORM,
body: [file: new FormData(value: new File('some.file'), contentType: ContentType.BINARY)])Major changes
Deprecated PrintingHttpPoet. You should now use the ConsolePrintingInterceptor instead, which does the same thing
poet.addInterceptor(new ConsolePrintingInterceptor(printFullUrl: false))
// now perform your requests, they will be printedOther changes
- added default query parameters
- added RateLimitInterceptor an interceptor waiting for the limit to finish when being rate limited
- unescaped json when printing it
- added error response handlers