Java / CURL:URL格式错误

时间:2015-03-10 16:21:22

标签: java linux curl

每次我在Java应用程序上运行此代码时都会出现URL格式错误

    ProcessBuilder pb = new ProcessBuilder(args = new String[] {"curl", "-v", "http://www.solarmovie.is/forum/login/",
     "-c", "\"cookies2.txt\"",
     "-b", "\"cookies2.txt\"",
     "-H", "\"Host: www.solarmovie.is\"",
     "-H", "\"Origin: http://www.solarmovie.is\"",
     "-H", "\"User-Agent: User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36\"",
     "-H", "\"Accept-Encoding: gzip, deflate\"",
     "-H", "\"Accept-Language: en-GB,en-US;q=0.8,en;q=0.6\"",
     "--compressed", "",
     "-H", "\"X-Requested-With: XMLHttpRequest\"",
     "-H", "\"Connection: keep-alive\"",
     "-H", "\"Content-Type: application/x-www-form-urlencoded; charset=UTF-\"",
     "-H", "\"Referer: http://www.solarmovie.is/\"",
     "--data", "\"referer=http\"%\"3A\"%\"2F\"%\"2Fwww.solarmovie.is\"%\"2F&login\"%\"5Blogin\"%\"5D="+username+"&login\"%\"5Bpassword\"%\"5D="+password + "\""
});

打印:

 % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                             Dload  Upload   Total   Spent    Left  Speed

0     0    0     0    0   135      0   3639 --:--:-- --:--:-- --:--:--  3639
106  2733    0  2733    0   135  14649    723 --:--:-- --:--:-- --:--:-- 17436

curl: (3) <url> malformed

那么我认为在linux java中试图请求超过1个请求?它做错了什么分裂。

P.S。不知何故应用程序适用于Windows,但不适用于Linux,在centos和ubutuu上进行测试

0 个答案:

没有答案