【发布时间】:2016-06-21 23:31:27
【问题描述】:
这是我的请求 xml:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Request>
<user>
<title>Mr</title>
<firstname>automation</firstname>
<lastname>Qa</lastname>
<department>Automation</department>
<mobile>999000777</mobile>
</user>
</Request>
这是我的实际放心代码:
String APIUrl = "http://autoTest.com/api/1/user/create";
HashMap<String, String> hashMap = new HashMap<>();
hashMap.put("title", "Mr");
hashMap.put("firstname", "automation");
hashMap.put("lastname", "testing");
hashMap.put("department", "test");
hashMap.put("mobile", "7878787");
Response response = RestAssured.given().auth().preemptive() .basic("userName", "passw0rd").
parameters(hashMap).when().post(APIUrl);
当我拨打这个电话时,它会给我以下控制台错误:
Bad request ,
Request resource or xml is not valid ,
Sorry, we could not find appropriate method or xml.
谁能帮我找出我做错了什么?
【问题讨论】:
标签: post rest-assured