use of com.loopj.android.http.AsyncHttpClient in project android-sex-http by dtboy1995.
the class HTTPUtil method setHttpPort.
public static void setHttpPort(int httpPort) {
HTTP_PORT = httpPort;
client = new AsyncHttpClient(true, HTTP_PORT, HTTPS_PORT);
client.setURLEncodingEnabled(false);
}
use of com.loopj.android.http.AsyncHttpClient in project android-sex-http by dtboy1995.
the class HTTPUtil method setHttpsPort.
public static void setHttpsPort(int httpsPort) {
HTTPS_PORT = httpsPort;
client = new AsyncHttpClient(true, HTTP_PORT, HTTPS_PORT);
client.setURLEncodingEnabled(false);
}
use of com.loopj.android.http.AsyncHttpClient in project xabber-android by redsolution.
the class FileManager method getFileUrlSize.
private static void getFileUrlSize(final MessageItem messageItem) {
LogManager.i(FileManager.class, "Requesting file size");
AsyncHttpClient client = new AsyncHttpClient();
client.head(messageItem.getText(), new AsyncHttpResponseHandler() {
@Override
public void onSuccess(int statusCode, Header[] headers, byte[] responseBody) {
for (Header header : headers) {
if (header.getName().equals(HttpHeaders.CONTENT_LENGTH)) {
messageItem.setFileSize(Long.parseLong(header.getValue()));
MessageManager.getInstance().onChatChanged(messageItem.getChat().getAccount(), messageItem.getChat().getUser(), false);
break;
}
}
}
@Override
public void onFailure(int statusCode, Header[] headers, byte[] responseBody, Throwable error) {
}
});
}
Aggregations