We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
因为core的XxlJobRemotingUtil.postBody方法里使用了 connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8"); connection.setRequestProperty("Accept-Charset", "application/json;charset=UTF-8");
而JobApiController 用的以下接收,data是接收不到数据的因为还有个uri的参数 @RequestMapping("/{uri}") @responsebody @PermissionLimit(limit=false) public ReturnT api(HttpServletRequest request, @PathVariable("uri") String uri, @requestbody(required = false) String data)
XxlJobRemotingUtil.postBody 我这边改成了 connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8"); connection.setRequestProperty("Accept-Charset", "application/x-www-form-urlencoded;charset=UTF-8");
请求的参数encode一下 String requestBody = URLEncoder.encode(GsonTool.toJson(requestObj), "UTF-8");
JobApiController接收时decode一下 data = URLDecoder.decode(data, Charset.forName("UTF-8")); 这样是可以注册的
The text was updated successfully, but these errors were encountered:
No branches or pull requests
因为core的XxlJobRemotingUtil.postBody方法里使用了
connection.setRequestProperty("Content-Type", "application/json;charset=UTF-8");
connection.setRequestProperty("Accept-Charset", "application/json;charset=UTF-8");
而JobApiController 用的以下接收,data是接收不到数据的因为还有个uri的参数
@RequestMapping("/{uri}")
@responsebody
@PermissionLimit(limit=false)
public ReturnT api(HttpServletRequest request, @PathVariable("uri") String uri, @requestbody(required = false) String data)
XxlJobRemotingUtil.postBody 我这边改成了
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded;charset=UTF-8");
connection.setRequestProperty("Accept-Charset", "application/x-www-form-urlencoded;charset=UTF-8");
请求的参数encode一下
String requestBody = URLEncoder.encode(GsonTool.toJson(requestObj), "UTF-8");
JobApiController接收时decode一下
data = URLDecoder.decode(data, Charset.forName("UTF-8"));
这样是可以注册的
The text was updated successfully, but these errors were encountered: