且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

远程服务器返回错误:(400)错误请求。

更新时间:2022-06-18 08:48:44

400 Bad Request 错误是 HTTP 状态代码,表示您发送给网站服务器的请求(例如加载网页的请求)以某种方式格式错误,因此服务器无法理解或处理请求。



检查URL中的错误。 400错误请求错误的最常见原因是因为URL输入错误或者点击的链接指向URL中存在某种错误。



--Amit
The 400 Bad Request error is an HTTP status code that means that the request you sent to the website server (e.g. a request to load a web page) was somehow malformed therefore the server was unable to understand or process the request.

Check for errors in the URL. The most common reason for a 400 Bad Request error is because the URL was typed wrong or the link that was clicked on points to a URL with some kind of mistake in it.

--Amit


我将使用下面的代码,并在浏览器地址栏中测试sBaseUrl,我认为编码需要是encoding.utf8,也许是文件夹令牌没有要附加的查询字符串的默认页面。



I would go with the following below, and test sBaseUrl in the browser address bar, I think it's the encoding needs to be encoding.utf8, and perhaps the folder token doesn't have a default page for the querystring to attach to.

sBaseUrl = httputility.Urlencode(sBaseUrl + sParameter, encoding.utf8);


400错误的身份验证将导致错误的请求异常。

1.检查您要发送的URL是有效的。

2.检查用户名和密码是否写。



注意:检查您是否留下任何空格。复制内容时
400 Bad request exception will cause due to the wrong authentication.
1. check the url which you are sending is valid.
2. check the username and password is write.

note: check whether your leaving any spaces. while copying the contents