This commit is contained in:
地平线
2015-06-17 09:53:23 +08:00
parent 703f2aad24
commit f81087686b

View File

@@ -385,6 +385,12 @@ public final class Utility {
conn.getOutputStream().write(body.getBytes(UTF_8));
}
conn.connect();
int rs = conn.getResponseCode();
if (rs == 301 || rs == 302) {
String newurl = conn.getHeaderField("Location");
conn.disconnect();
return remoteHttpContent(ctx, method, newurl, body);
}
InputStream in = conn.getInputStream();
ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
byte[] bytes = new byte[1024];