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


Java RequestSpecification.body方法代码示例

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


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

示例1: to

import io.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
@When("^I send an empty body to ([\\w-]+)(/[\\w-]+)$")
public void I_send_an_empty_body_to_service_api(String serviceName, String api) {
    RequestSpecification request = request(serviceName);
    request.header("Content-Type", "application/json");
    request.header("token", "ZVtrRXcpTnYWpsjnIpS3olQFGek84E5Z");
    request.body(new byte[0]);
    Response response = request.post(api);
    statusCode = response.getStatusCode();
}
 
开发者ID:intellead,项目名称:intellead-integration-tests,代码行数:10,代码来源:Steps.java

示例2: id

import io.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
@When("^I send lead with id (\\d+) to ([\\w-]+)(/[\\w-/]+)$")
public void I_send_lead_with_id_to_service_api(int leadId, String serviceName, String api) {
    RequestSpecification request = request(serviceName);
    request.header("Content-Type", "application/json");
    request.header("token", "ZVtrRXcpTnYWpsjnIpS3olQFGek84E5Z");
    request.body(Leads.getLead(leadId).toString());
    Response response = request.post(api);
    statusCode = response.getStatusCode();
}
 
开发者ID:intellead,项目名称:intellead-integration-tests,代码行数:10,代码来源:Steps.java

示例3: execute

import io.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
public ValidatableResponse execute() {
    RequestSpecification request = given();
    if (contentType != null) {
        request.contentType(contentType);
    }

    if (headers != null) {
        request.headers(headers);
    }

    if (cookie != null) {
        request.cookie(cookie);
    }

    if (body != null) {
        request.body(body);
    }

    String requestStr = createRequestLog();

    ValidatableResponse response = request
            .urlEncodingEnabled(false)
            .request(method, url)
            .then();

    String responseStr = createResponseLog(response);

    appendToFile(requestStr, responseStr);

    return response;
}
 
开发者ID:Atypon-OpenSource,项目名称:wayf-cloud,代码行数:32,代码来源:LoggingHttpRequestFactory.java

示例4: beforeRequest

import io.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
@Override
public void beforeRequest(RequestSpecification requestSpecification) {
    String requestBody = this.requestFacade.getRequestBody();
    if (requestBody != null) {
        String processed = templatingEngine.processBody(requestBody);
        requestSpecification.body(processed);
    }
}
 
开发者ID:ctco,项目名称:cukes,代码行数:9,代码来源:PreprocessRestRequestBody.java

示例5: beforeRequest

import io.restassured.specification.RequestSpecification; //导入方法依赖的package包/类
@Override
public void beforeRequest(RequestSpecification requestSpecification) {
    GraphQLRequest graphQLRequest = requestFacade.getGraphQLRequest();
    if (!Strings.isNullOrEmpty(graphQLRequest.getQuery())) {
        graphQLRequest.setQuery(templatingEngine.processBody(graphQLRequest.getQuery()));
    }
    if (!Strings.isNullOrEmpty(graphQLRequest.getVariables())) {
        graphQLRequest.setVariables(templatingEngine.processBody(graphQLRequest.getVariables()));
    }
    requestSpecification.body(graphQLRequest);
}
 
开发者ID:ctco,项目名称:cukes,代码行数:12,代码来源:PreprocessGraphQLRequestBody.java


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