Skip to content

added POST method using HttpEntity parameters #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/com/loopj/android/http/AsyncHttpClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,14 @@ public void addHeader(String header, String value) {
clientHeaderMap.put(header, value);
}

/**
* Remove header from all requests this client makes (before sending).
* @param header the name of the header
*/
public void removeHeader(String header) {
clientHeaderMap.remove(header);
}

/**
* Sets basic authentication for the request. Uses AuthScope.ANY. This is the same as
* setBasicAuth('username','password',AuthScope.ANY)
Expand Down
4 changes: 0 additions & 4 deletions src/com/loopj/android/http/AsyncHttpResponseHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
import org.apache.http.entity.BufferedHttpEntity;
import org.apache.http.util.EntityUtils;

import android.os.Handler;
import android.os.Looper;
import android.os.Message;

/**
* Used to intercept and handle the responses from requests made using
* {@link AsyncHttpClient}. The {@link #onSuccess(String)} method is
Expand Down
6 changes: 6 additions & 0 deletions src/com/loopj/android/http/SyncHttpClient.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.loopj.android.http;

import org.apache.http.HttpEntity;
import org.apache.http.client.methods.HttpUriRequest;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.protocol.HttpContext;
Expand Down Expand Up @@ -110,6 +111,11 @@ public String post(String url) {
return result;
}

public String post(String url, HttpEntity entity){
this.post(null, url, entity, null, responseHandler);
return result;
}

public String delete(String url, RequestParams params) {
this.delete(url, params, responseHandler);
return result;
Expand Down