org.restlet.data.Request.setEntity()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.1k)|赞(0)|评价(0)|浏览(296)

本文整理了Java中org.restlet.data.Request.setEntity方法的一些代码示例,展示了Request.setEntity的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setEntity方法的具体详情如下:
包路径:org.restlet.data.Request
类名称:Request
方法名:setEntity

Request.setEntity介绍

暂无

代码示例

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Sets a textual entity.
  3. *
  4. * @param value
  5. * The represented string.
  6. * @param mediaType
  7. * The representation's media type.
  8. */
  9. @Override
  10. public void setEntity(String value, MediaType mediaType) {
  11. getWrappedRequest().setEntity(value, mediaType);
  12. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Sets the entity representation.
  3. *
  4. * @param entity
  5. * The entity representation.
  6. */
  7. @Override
  8. public void setEntity(Representation entity) {
  9. getWrappedRequest().setEntity(entity);
  10. }

代码示例来源:origin: org.restlet/org.restlet

  1. /**
  2. * Sets the entity from a higher-level object. This object is converted to a
  3. * representation using the Application's converter service. If you want to
  4. * use this method to facilitate the setting of entities, you need to
  5. * provide a custom implementation of the ConverterService class, overriding
  6. * the toRepresentation(Object) method.
  7. *
  8. * @param object
  9. * The higher-level object.
  10. * @deprecated Since 1.1, the ConverterService is deprecated, with no
  11. * replacement as it doesn't fit well with content negotiation.
  12. * Most users prefer to handle those conversion in Resource
  13. * subclasses.
  14. */
  15. @Override
  16. @Deprecated
  17. public void setEntity(Object object) {
  18. getWrappedRequest().setEntity(object);
  19. }

代码示例来源:origin: org.restlet/org.restlet

  1. @Override
  2. protected int beforeHandle(Request request, Response response) {
  3. if (getMode() == MODE_REQUEST) {
  4. request.setEntity(transform(request.getEntity()));
  5. }
  6. return CONTINUE;
  7. }

代码示例来源:origin: org.restlet/org.restlet.ext.xml

  1. @Override
  2. protected int beforeHandle(Request request, Response response) {
  3. if (getMode() == MODE_REQUEST) {
  4. request.setEntity(transform(request.getEntity()));
  5. }
  6. return CONTINUE;
  7. }

代码示例来源:origin: org.sonatype.nexus/nexus-rest-client-java

  1. public Response sendRequest( Method method, String url, Representation representation )
  2. {
  3. this.logger.debug( "Method: " + method.getName() + " url: " + url );
  4. Request request = new Request();
  5. request.setResourceRef( url );
  6. request.setMethod( method );
  7. if ( !Method.GET.equals( method ) && !Method.DELETE.equals( method ) )
  8. {
  9. request.setEntity( representation );
  10. }
  11. request.setChallengeResponse( this.challenge );
  12. return this.restClient.handle( request );
  13. }

代码示例来源:origin: org.sonatype.nexus/nexus-test-utils

  1. request.setEntity( representation );

代码示例来源:origin: org.sonatype.nexus/nexus-test-harness-launcher

  1. request.setEntity(representation);

代码示例来源:origin: uk.org.mygrid.remotetaverna/taverna-rest-client

  1. private Response request(Method method, Reference uri,
  2. Representation representation, MediaType accepts, boolean checkSuccess)
  3. throws NotSuccessException {
  4. Request request = makeRequest(uri, accepts);
  5. request.setMethod(method);
  6. if (representation != null) {
  7. request.setEntity(representation);
  8. }
  9. Client client = new Client(Protocol.HTTP);
  10. Response response = client.handle(request);
  11. if (checkSuccess && !response.getStatus().isSuccess()) {
  12. logger.warn("Not success: " + response.getStatus());
  13. throw new NotSuccessException(response.getStatus());
  14. }
  15. return response;
  16. }

代码示例来源:origin: org.sonatype.nexus/nexus-test-harness-base

  1. request.setEntity( representation );

相关文章