如何使用附加组件Rested Client进行测试

时间:2018-02-22 08:50:54

标签: javascript html rest add-on

任何人都知道如何在RESTED Add ons mozilla中编写此内容



<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
var form = new FormData();
form.append("cluster", "pejaten");
form.append("content", "Jokowi");
form.append("flag", "");

var settings = {
  "async": true,
  "crossDomain": true,
  "url": "http://10.100.17.245:8081/manager/services/client/processString",
  "method": "POST",
  "headers": {
    "Accept": "text/xml"
  },
  "processData": false,
  "contentType": false,
  "mimeType": "multipart/form-data",
  "data": form
}

$.ajax(settings).done(function (response) {
  console.log(response);
});
</script>
&#13;
&#13;
&#13;

并取得了成功..

但是,我尝试使用mozile显示错误400中的休息加载项。 请纠正我

enter image description here

错误标题显示:

&#13;
&#13;
Date: Thu, 22 Feb 2018 08:40:45 GMT
Cache-Control: must-revalidate,no-cache,no-store
Content-Type: text/html;charset=iso-8859-1
Content-Length: 354
Server: Jetty(9.3.z-SNAPSHOT)
&#13;
&#13;
&#13;

错误回顾展示:

&#13;
&#13;
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 400 </title>
</head>
<body>
<h2>HTTP ERROR: 400</h2>
<p>Problem accessing /manager/services/client/processString. Reason:
<pre>    Bad Request</pre></p>
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.z-SNAPSHOT</a><hr/>
</body>
</html>
&#13;
&#13;
&#13;

0 个答案:

没有答案