public static String sendPost (String postUrl) throws the Exception {
The String url=postUrl;
The String result="";
Try {
//System. SetProperty (" HTTPS. Separate protocols ", "TLSv1, TLSv1.2, SSLv3");
The HttpRequest post=HttpUtil. CreateGet (url);
Post. The header (" Authorization ", Authorization);
Post. ContentType (" application/json; charset=UTF-8");
Post. Charset (" utf-8 ");
Post. A timeout (300000);
HttpResponse execute=post. The execute ();
If (execute) isOk ()) {
Result=the execute. Body ();
Logger. The info (" the returned data is: "+ result);
} else {
Logger. The info (" request failure & gt;>" + the execute. Body ());
}
} the catch (Exception e) {
e.printStackTrace();
}
return result;
}
Now I would like to request a url, but the error log at 400, have bosses know what's going on?
INFO. [the main] com winchannel. Viet. Start. SendPost (561) - failed to request & gt;>Bad Request
<meta HTTP - EQUIV="content-type" Content="text/HTML. Charset=us - ASCII "& gt;
<body>
HTTP Error 400. The request verb is invalid. & lt;/p>