Skip to content

new features onStatusReceived, onHeadersReceived, onBodyPartReceived #737

Open
@kamilwlf

Description

@kamilwlf

What do you think about adding:

@Override
    public STATE onStatusReceived(HttpResponseStatus status) throws Exception {
        int statusCode = status.getStatusCode();
        // The Status have been read
        // If you don't want to read the headers,body or stop processing the response
        if (statusCode >= 500) {
            return STATE.ABORT;
        }
    }
    @Override
    public STATE onHeadersReceived(HttpResponseHeaders h) throws Exception {
        Headers headers = h.getHeaders();
         // The headers have been read
         // If you don't want to read the body, or stop processing the response
         return STATE.ABORT;
    }
    @Override
    public STATE onBodyPartReceived(HttpResponseBodyPart bodyPart) throws Exception {
         bytes.write(bodyPart.getBodyPartBytes());
         return STATE.CONTINUE;

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions