Mar*_*anu 2 javascript java rest post angularjs
我正在使用 RESTful 服务(使用 Jersey)开发带有 AngularJS(客户端)和 Java(服务器端)的应用程序。
在客户端我有这样的事情
$http({
url : "/Something/rest/...",
method : "POST",
headers : {
...
'text' : text
}
});
Run Code Online (Sandbox Code Playgroud)
在服务器端,我的 Java 方法标头如下所示
public JSONObject myMethod(@HeaderParam("text") String text [...]) throws JSONException
Run Code Online (Sandbox Code Playgroud)
我在尝试发送请求时收到此错误
Error: Failed to execute 'setRequestHeader' on 'XMLHttpRequest': 'Some text here formatted with \n and \t' is not a valid HTTP header field value.
Run Code Online (Sandbox Code Playgroud)
这是因为格式吗?是不是因为文字很长?
我应该改变什么?请指导我
| 归档时间: |
|
| 查看次数: |
28253 次 |
| 最近记录: |