Example usage for org.apache.http.client.methods HttpPostHC4 addHeader

List of usage examples for org.apache.http.client.methods HttpPostHC4 addHeader

Introduction

In this page you can find the example usage for org.apache.http.client.methods HttpPostHC4 addHeader.

Prototype

public void addHeader(String str, String str2) 

Source Link

Usage

From source file:org.thoughtcrime.securesms.mms.OutgoingMmsConnection.java

@Override
protected HttpUriRequest constructRequest(boolean useProxy) throws IOException {
    HttpPostHC4 request = new HttpPostHC4(apn.getMmsc());
    request.addHeader("Accept", "*/*, application/vnd.wap.mms-message, application/vnd.wap.sic");
    request.addHeader("x-wap-profile", "http://www.google.com/oha/rdf/ua-profile-kila.xml");
    request.addHeader("Content-Type", "application/vnd.wap.mms-message");
    request.setEntity(new ByteArrayEntityHC4(mms));
    if (useProxy) {
        HttpHost proxy = new HttpHost(apn.getProxy(), apn.getPort());
        request.setConfig(RequestConfig.custom().setProxy(proxy).build());
    }//ww w  . j  a  v  a  2 s  .c o  m
    return request;
}