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

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

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

Request.setMethod介绍

[英]Sets the method called.
[中]设置调用的方法。

代码示例

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

/**
 * Sets the method called.
 * 
 * @param method
 *            The method called.
 */
@Override
public void setMethod(Method method) {
  getWrappedRequest().setMethod(method);
}

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

/**
 * Constructor.
 * 
 * @param method
 *            The call's method.
 * @param resourceRef
 *            The resource reference.
 * @param entity
 *            The entity.
 */
public Request(Method method, Reference resourceRef, Representation entity) {
  super(entity);
  setMethod(method);
  setResourceRef(resourceRef);
}

代码示例来源: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.setMethod( method );

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

request.setMethod(method);

代码示例来源: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.setMethod( method );

相关文章