场景

spring请求时报错:
java.net.URISyntaxException: Illegal character in scheme name at index 0: %7B%0D%0A%20%20%20%20%22url%22:

解决方案

请求报文:

{
"url": "http://s.longhu.net/record/2636160/jxindependent/jxindependent.war"
}

伪代码(没贴get、set):

public class FileRequest {
private String url;
}
public String httpGetFile(@RequestBody String url){}

发现问题了吗?

错误代码:
public String httpGetFile(@RequestBody String url){}

正确代码:
public String httpGetFile(@RequestBody FileRequest fileRequest){}

问题解决。