Http response header

How could I set my own key value pair in http response headers

try on these lines

HttpHeader respHeader = Service.getHttpResponseHeader();


u may need to import class



Thank you for the response

This did not add the values to the header
can you give the complete code pls


Hi all,

I could not find the java documentation for HttpHeader class. can somebody help me with a working sample code on how to add custom values to response http header pls

Many thanks


The class in the IS Server Java API is undocumented.
Here’s what I know about three methods in that class:

// Set HTTP response code
// Set HTTP response code with reason phrase
setResponseCode(ResponseCode_Integer, ResponseReasonPhrase_String);
//Add HTTP response field.
addField(HeaderFieldName_String, HeaderFieldValue_String);

Your code should work if you import the class. Eg: h = Service.getHttpResponseHeader(null);
h.setResponse(302, “Found”);
h.addField(“Location”, URL);

Similar to setResponse you can also use these

respHeader.setResponseMessage(“New Message goes here”);

and ofcourse the one mentioned above by sonam

respHeader.setResponse(800,“Another Message”);

I am sorry respHeader.setValues((Values)pipeline) did not yeild any results. I did not try it before thought that might do the work. Maybe somebody would be able to say WHAT THEN it is doing




actually setValues works, but you have to setResponse first.

I created following service to set Http headers (check attached picture for service inputs):

HttpHeader respHeader = Service.getHttpResponseHeader(null);
// pipeline
IDataCursor pipelineCursor = pipeline.getCursor();

    // header
    IData    header = IDataUtil.getIData( pipelineCursor, "header" );

    if ( header != null)

        IDataCursor headerCursor = header.getCursor();

            String status = IDataUtil.getString( headerCursor, "status" );
            String statusMessage = IDataUtil.getString( headerCursor, "statusMessage" );        
            respHeader.setResponse(Integer.parseInt(status), statusMessage);

            /* not needed as we're passing Values type
            // i.lines
            IData    lines = IDataUtil.getIData( headerCursor, "lines" );
            if ( lines != null)
                IDataCursor linesCursor = lines.getCursor();
                    String    Date = IDataUtil.getString( linesCursor, "Date" );
                    String    Server = IDataUtil.getString( linesCursor, "Server" );
                    String    Content_Type = IDataUtil.getString( linesCursor, "Content-Type" );
                    String    Connection = IDataUtil.getString( linesCursor, "Connection" );
                    respHeader.addField("Date", Date);
                    respHeader.addField("Server", Server);
                    respHeader.addField("Content-Type", Content_Type);
                    respHeader.addField("Connection", Connection);


Don’t forget to put into imports section.