public static final class PSHTTPResource.Builder extends Object
Constructor and Description |
---|
PSHTTPResource.Builder()
Creates a new builder for a PageSeeder resource.
|
PSHTTPResource.Builder(PSHTTPResourceType type,
String name)
Creates a new builder for a PageSeeder resource.
|
Modifier and Type | Method and Description |
---|---|
PSHTTPResource.Builder |
addParameter(String name,
String value)
Add a parameter to this request.
|
PSHTTPResource.Builder |
body(String body)
Sets the body of the resource (used for PUT requests).
|
PSHTTPResource |
build()
Build the resource from the specified arguments.
|
protected void |
includeErrorContent(boolean include)
Indicates whether this resource should include the error content.
|
PSHTTPResource.Builder |
name(String name)
Sets the name of the resource.
|
PSHTTPResource.Builder |
type(PSHTTPResourceType type)
Sets the type of the resource.
|
public PSHTTPResource.Builder()
public PSHTTPResource.Builder(PSHTTPResourceType type, String name)
type
- The type of resource.name
- The name of the resource to access (depends on the type of resource)public PSHTTPResource.Builder type(PSHTTPResourceType type)
type
- the type of the resource to retrieve.public PSHTTPResource.Builder name(String name)
name
- the name of the resource to retrieve.public PSHTTPResource.Builder body(String body)
body
- the body of the resource.protected void includeErrorContent(boolean include)
include
- true
to include the content of response even when the response code is greater than 400;
false
to only include the response when the response code is between 200 and 299.public PSHTTPResource.Builder addParameter(String name, String value)
name
- The name of the parametervalue
- The value of the parameterpublic PSHTTPResource build()
Copyright © 2016 Allette Systems. All rights reserved.