def write_header(self, chunk):
        """Write to header.

        Note: the header stream is only available to write before write body.

        :param chunk: content to write to header

        :except TChannelError:
            Raise TChannelError if the response's flush() has been called
        """

        if self.serializer:
            header = self.serializer.serialize_header(chunk)
        else:
            header = chunk

        if self.flushed:
            raise TChannelError("write operation invalid after flush call")

        if (self.argstreams[0].state != StreamState.completed and
                self.argstreams[0].auto_close):
            self.argstreams[0].close()

        return self.argstreams[1].write(header)
def write_header ( self , chunk ) : if self . serializer : header = self . serializer . serialize_header ( chunk ) else : header = chunk if self . flushed : raise TChannelError ( "write operation invalid after flush call" ) if ( self . argstreams [ 0 ] . state != StreamState . completed and self . argstreams [ 0 ] . auto_close ) : self . argstreams [ 0 ] . close ( ) return self . argstreams [ 1 ] . write ( header )
Write to header.

        Note: the header stream is only available to write before write body.

        :param chunk: content to write to header

        :except TChannelError:
            Raise TChannelError if the response's flush() has been called