Forum Stats

  • 3,814,896 Users
  • 2,258,926 Discussions
  • 7,892,883 Comments

Discussions

User-defined http header and com.oracle.httpclient.HttpRequestBuilder

Bruno L
Bruno L Member Posts: 8
edited May 30, 2014 12:05PM in Java ME Embedded

Hello,

In Java ME Embedded 8, I would like to send a HTTP request containing a user-defined identifier in the http header (X- header type), using the com.oracle.httpclient package.

       HttpClient client = clientBuilder.build();

        HttpRequestBuilder requestBuilder = client.build(http://my_uri);
        requestBuilder.setHeader(HttpHeader.ACCEPT, "text/plain");

Here, I would like to add a user-defined header value like :
      requestBuilder.setHeader("MyHeader", "myHeaderValue");

It seems that there are only pre-defined values available for headers in the com.oracle.httpclient.HttpHeader class.

Is there any way to add a user-defined header in the request ?

Thanks in advance.

Bruno

Bruno L

Best Answer

Answers

This discussion has been closed.