本文整理了Java中org.restlet.data.Request.setMethod
方法的一些代码示例,展示了Request.setMethod
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Request.setMethod
方法的具体详情如下:
包路径:org.restlet.data.Request
类名称: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 );
内容来源于网络,如有侵权,请联系作者删除!