com.thoughtworks.webstub.dsl.builders.EntityEnclosingRequestBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of web-stub Show documentation
Show all versions of web-stub Show documentation
Library for stubbing external HTTP dependencies
The newest version!
package com.thoughtworks.webstub.dsl.builders;
import com.thoughtworks.webstub.config.ConfigurationProvider;
import com.thoughtworks.webstub.config.Request;
public class EntityEnclosingRequestBuilder extends RequestBuilder {
private String content;
public EntityEnclosingRequestBuilder(ConfigurationProvider configurationProvider) {
super(configurationProvider);
}
public EntityEnclosingRequestBuilder withContent(String content) {
return withContent(new StringContentBuilder(content));
}
public EntityEnclosingRequestBuilder withContent(ContentBuilder contentBuilder) {
this.content = contentBuilder.build();
return this;
}
@Override
protected Request build() {
return new Request(method, uri, content, headers);
}
}