本文整理了Java中org.restlet.data.Request.setEntity
方法的一些代码示例,展示了Request.setEntity
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setEntity
方法的具体详情如下:
包路径:org.restlet.data.Request
类名称:Request
方法名:setEntity
暂无
代码示例来源:origin: org.restlet/org.restlet
/**
* Sets a textual entity.
*
* @param value
* The represented string.
* @param mediaType
* The representation's media type.
*/
@Override
public void setEntity(String value, MediaType mediaType) {
getWrappedRequest().setEntity(value, mediaType);
}
代码示例来源:origin: org.restlet/org.restlet
/**
* Sets the entity representation.
*
* @param entity
* The entity representation.
*/
@Override
public void setEntity(Representation entity) {
getWrappedRequest().setEntity(entity);
}
代码示例来源:origin: org.restlet/org.restlet
/**
* Sets the entity from a higher-level object. This object is converted to a
* representation using the Application's converter service. If you want to
* use this method to facilitate the setting of entities, you need to
* provide a custom implementation of the ConverterService class, overriding
* the toRepresentation(Object) method.
*
* @param object
* The higher-level object.
* @deprecated Since 1.1, the ConverterService is deprecated, with no
* replacement as it doesn't fit well with content negotiation.
* Most users prefer to handle those conversion in Resource
* subclasses.
*/
@Override
@Deprecated
public void setEntity(Object object) {
getWrappedRequest().setEntity(object);
}
代码示例来源:origin: org.restlet/org.restlet
@Override
protected int beforeHandle(Request request, Response response) {
if (getMode() == MODE_REQUEST) {
request.setEntity(transform(request.getEntity()));
}
return CONTINUE;
}
代码示例来源:origin: org.restlet/org.restlet.ext.xml
@Override
protected int beforeHandle(Request request, Response response) {
if (getMode() == MODE_REQUEST) {
request.setEntity(transform(request.getEntity()));
}
return CONTINUE;
}
代码示例来源:origin: org.sonatype.nexus/nexus-rest-client-java
public Response sendRequest( Method method, String url, Representation representation )
{
this.logger.debug( "Method: " + method.getName() + " url: " + url );
Request request = new Request();
request.setResourceRef( url );
request.setMethod( method );
if ( !Method.GET.equals( method ) && !Method.DELETE.equals( method ) )
{
request.setEntity( representation );
}
request.setChallengeResponse( this.challenge );
return this.restClient.handle( request );
}
代码示例来源:origin: org.sonatype.nexus/nexus-test-utils
request.setEntity( representation );
代码示例来源:origin: org.sonatype.nexus/nexus-test-harness-launcher
request.setEntity(representation);
代码示例来源:origin: uk.org.mygrid.remotetaverna/taverna-rest-client
private Response request(Method method, Reference uri,
Representation representation, MediaType accepts, boolean checkSuccess)
throws NotSuccessException {
Request request = makeRequest(uri, accepts);
request.setMethod(method);
if (representation != null) {
request.setEntity(representation);
}
Client client = new Client(Protocol.HTTP);
Response response = client.handle(request);
if (checkSuccess && !response.getStatus().isSuccess()) {
logger.warn("Not success: " + response.getStatus());
throw new NotSuccessException(response.getStatus());
}
return response;
}
代码示例来源:origin: org.sonatype.nexus/nexus-test-harness-base
request.setEntity( representation );
内容来源于网络,如有侵权,请联系作者删除!