请检查我的 logcat。这是我在解析 http 响应时得到的结果。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>503 Service Unavailable</title>
</head>
<body>
<h1>Error 503 Service Unavailable</h1>
<p>Service Unavailable</p>
<h3>Guru Meditation:</h3>
<p>XID: 1294992728</p>
<hr>
<p>Varnish cache server</p>
</body>
</html>
我在将图像从 android 上传到服务器时收到此响应。有人可以帮我解决这个问题吗?
最佳答案
正如您所说的错误是来自服务器的 503,请检查 this link 一次。它声明503错误可能由于以下原因而发生:
- Obtain an IP address from the IP name of the site (the site URL without the leading 'http://'). This lookup (conversion of IP name to IP address) is provided by domain name servers (DNSs).
- Open an IP socket connection to that IP address.
- Write an HTTP data stream through that socket.
- Receive an HTTP data stream back from the Web server in response. This data stream contains status codes whose values are determined by the HTTP protocol. Parse this data stream for status codes and other useful information.
关于android - 在 Android 中获取 503 作为 Http 响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17335502/