Example usage for org.apache.mina.http.api HttpVersion HTTP_1_1

List of usage examples for org.apache.mina.http.api HttpVersion HTTP_1_1

Introduction

In this page you can find the example usage for org.apache.mina.http.api HttpVersion HTTP_1_1.

Prototype

HttpVersion HTTP_1_1

To view the source code for org.apache.mina.http.api HttpVersion HTTP_1_1.

Click Source Link

Document

HTTP 1/1

Usage

From source file:audio.broadcast.icecast.IcecastBroadcastMetadataUpdater.java

License:Open Source License

/**
 * Creates an HTTP GET request to update the metadata on the remote server
 *//*  w  ww.j a va2  s. co m*/
private HttpRequest createUpdateRequest(String song) {
    try {
        StringBuilder sb = new StringBuilder();
        sb.append("mode=updinfo");
        sb.append("&mount=").append(URLEncoder.encode(mIcecastConfiguration.getMountPoint(), UTF8));
        sb.append("&charset=UTF%2d8");
        sb.append("&song=").append(URLEncoder.encode(song, UTF8));

        HttpRequestImpl request = new HttpRequestImpl(HttpVersion.HTTP_1_1, HttpMethod.GET, "/admin/metadata",
                sb.toString(), getHTTPHeaders());

        return request;
    } catch (UnsupportedEncodingException e) {
        //This should never happen
        mLog.error("UTF-8 encoding is not supported - can't update song metadata");
    }

    return null;
}