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

com.thoughtworks.webstub.dsl.HttpDsl Maven / Gradle / Ivy

There is a newer version: 1.1.0
Show newest version
package com.thoughtworks.webstub.dsl;

import com.thoughtworks.webstub.config.*;
import com.thoughtworks.webstub.dsl.builders.EntityEnclosingRequestBuilder;
import com.thoughtworks.webstub.dsl.builders.RequestBuilder;

public class HttpDsl extends ConfigurationProvider {

    public HttpDsl(ConfigurationListener listener) {
        super(listener);
    }

    public RequestBuilder get(String uri) {
        return new RequestBuilder(this).withMethod("GET").withUri(uri);
    }

    public EntityEnclosingRequestBuilder post(String uri) {
        return new EntityEnclosingRequestBuilder(this).withMethod("POST").withUri(uri);
    }

    public EntityEnclosingRequestBuilder put(String uri) {
        return new EntityEnclosingRequestBuilder(this).withMethod("PUT").withUri(uri);
    }

    public RequestBuilder delete(String uri) {
        return new RequestBuilder(this).withMethod("DELETE").withUri(uri);
    }

    public void reset() {
        configurationCleared();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy