Skip to content
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

Use constant for Content-Type header name. #87

Merged
merged 1 commit into from Oct 29, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions http/src/main/java/retrofit/http/HttpMethodType.java
Expand Up @@ -18,6 +18,7 @@
import org.apache.http.client.utils.URIUtils;
import org.apache.http.client.utils.URLEncodedUtils;
import org.apache.http.entity.mime.HttpMultipartMode;
import org.apache.http.entity.mime.MIME;
import org.apache.http.entity.mime.MultipartEntity;
import org.apache.http.entity.mime.content.StringBody;
import org.apache.http.protocol.HTTP;
Expand Down Expand Up @@ -100,7 +101,7 @@ private static URI getParameterizedUri(HttpRequestBuilder builder)
private static void addHeaders(HttpMessage message, HttpRequestBuilder builder) {
String mimeType = builder.getMimeType();
if (mimeType != null) {
message.addHeader("Content-Type", mimeType);
message.addHeader(MIME.CONTENT_TYPE, mimeType);
}
Headers headers = builder.getHeaders();
if (headers != null) {
Expand Down Expand Up @@ -149,7 +150,7 @@ private static void addParams(HttpEntityEnclosingRequestBase request,
if (builder.getSingleEntity() != null) {
final TypedBytesEntity entity = new TypedBytesEntity(builder.getSingleEntity());
request.setEntity(entity);
request.addHeader("Content-Type", entity.getMimeType().mimeName());
request.addHeader(MIME.CONTENT_TYPE, entity.getMimeType().mimeName());
} else {
List<NameValuePair> paramList = builder.getParamList(true);
// TODO: Use specified encoding. (See CallbackResponseHandler et al)
Expand Down