You can add the following options to the start of the response:
var response = "HTTP Status: 404\r\n";
response += "http.header.Content-Type=text/plain\r\n";
response += "http.header.myToken=ABCDEF\r\n";
response += "\r\n";
response += "This is my payload";
qie.postMessageResponse(response);
The HTTP Status can return any integer value for the status code.
The Content-Type allows you to specify the payload content type.
The http header can be any additional headers that are needed in the response. To specify a header, you will prefix the header name with "http.header.", separate the header name (key) and the value with a colon (=), and end with a carriage return line feed (\r\n).
Make sure that you have set your source node to response to "From Mapping or Destination node"

You can create a custom mapping function withe the qie.postMessageResponse(response);

See also:
Handling HTTP requests and responses
Posting Responses via qie.postMessageResponse() in a channel that uses an HTTP Listener source node