当前位置: 首页>>代码示例>>Java>>正文


Java RequestSpecification.post方法代码示例

本文整理汇总了Java中com.jayway.restassured.specification.RequestSpecification.post方法的典型用法代码示例。如果您正苦于以下问题:Java RequestSpecification.post方法的具体用法?Java RequestSpecification.post怎么用?Java RequestSpecification.post使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.jayway.restassured.specification.RequestSpecification的用法示例。


在下文中一共展示了RequestSpecification.post方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: scenarioExecution

import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
private Response scenarioExecution(HttpScenarioStepBinary binaryScenario, String baseUrl) {
	RequestSpecification specification = expect().
			statusCode(binaryScenario._expectedHttpStatusCode).
			body(binaryScenario._expectedJsonBodyMatcher).
			when().
			given().
			multiPart(binaryScenario._filePartName, "", binaryScenario._requestBody, binaryScenario._requestBodyContentType).
			headers(binaryScenario._headers).
			queryParameters(binaryScenario._parameters);
	
	if (binaryScenario._httpMethod.equals(HttpMethod.POST.toString())) { 
		return specification.post(baseUrl + binaryScenario._partialRestURL);
	} else if (binaryScenario._httpMethod.equals(HttpMethod.PUT.toString())) {
		return specification.put(baseUrl + binaryScenario._partialRestURL);
	} else {
		throw new UnsupportedOperationException("Binary only works with POST and PUT");
	}
}
 
开发者ID:bioko,项目名称:http-test,代码行数:19,代码来源:ScenarioRunner.java

示例2: create

import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public ObjectNode create(RequestSpecification request)
{
	final String resolvedPath = getResolvedPath();
	Response response = request.post(resolvedPath);
	String location = response.getHeader("Location");
	Assert.assertNotNull(location, "Location on create request to " + resolvedPath + " is null");
	ObjectNode object = object(successfulRequest().get(location));
	final ID id = getId(object);
	cleanUpController.addCleanup(new StandardCleanupAfter(id));
	return object;
}
 
开发者ID:equella,项目名称:Equella,代码行数:12,代码来源:AbstractCleanupRequests.java

示例3: send

import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public static Response send(RequestSpecification request, String methodPath, HttpMethodType methodType)
{
	Response response = null;
	SystemProxy.setupProxy();
	switch (methodType)
	{
	case HEAD:
		response = request.head(methodPath);
		break;
	case GET:
		response = request.get(methodPath);
		break;
	case PUT:
		response = request.put(methodPath);
		break;
	case POST:
		response = request.post(methodPath);
		break;
	case DELETE:
		response = request.delete(methodPath);
		break;
	case PATCH:
		response = request.patch(methodPath);
		break;
	default:
		throw new RuntimeException("MethodType is not specified for the API method: " + methodPath);
	}

	return response;
}
 
开发者ID:qaprosoft,项目名称:carina,代码行数:31,代码来源:HttpClient.java

示例4: createFail

import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public Response createFail(RequestSpecification request)
{
	return request.post(getResolvedPath());
}
 
开发者ID:equella,项目名称:Equella,代码行数:5,代码来源:AbstractCleanupRequests.java

示例5: importer

import com.jayway.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public Response importer(RequestSpecification req)
{
	return req.post(getResolvedPath());
}
 
开发者ID:equella,项目名称:Equella,代码行数:5,代码来源:AbstractCleanupRequests.java


注:本文中的com.jayway.restassured.specification.RequestSpecification.post方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。