All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.smartboot.http.client.HttpGet Maven / Gradle / Ivy

There is a newer version: 1.4.3
Show newest version
/*******************************************************************************
 * Copyright (c) 2017-2021, org.smartboot. All rights reserved.
 * project name: smart-http
 * file name: HttpGet.java
 * Date: 2021-02-04
 * Author: sandao ([email protected])
 ******************************************************************************/

package org.smartboot.http.client;

import org.smartboot.http.common.enums.HttpMethodEnum;
import org.smartboot.socket.transport.AioSession;

import java.util.AbstractQueue;
import java.util.function.Consumer;

/**
 * @author 三刀([email protected])
 * @version V1.0 , 2021/2/3
 */
public class HttpGet extends HttpRest {

    HttpGet(AioSession session, AbstractQueue queue) {
        super(session, queue);
        request.setMethod(HttpMethodEnum.GET.getMethod());
    }

    @Override
    public HttpGet setMethod(String method) throws UnsupportedOperationException {
        throw new UnsupportedOperationException();
    }

    @Override
    public HttpGet onSuccess(Consumer consumer) {
        super.onSuccess(consumer);
        return this;
    }

    @Override
    public HttpGet onFailure(Consumer consumer) {
        super.onFailure(consumer);
        return this;
    }

    @Override
    public Header header() {
        return new HeaderWrapper<>(this, super.header());
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy