#NEWLINE# def _self_build( obj , field_pos_list = None ) : #NEWLINE# #INDENT# ' Takse an HTTPRequest or HTTPResponse object, and creates its internal\n    scapy representation as a string. That is, generates the HTTP\n    packet as a string ' #NEWLINE# p = '' #NEWLINE# for f in obj . fields_desc : #NEWLINE# #INDENT# val = obj . getfieldval ( f . name ) #NEWLINE# if ( not val ) : #NEWLINE# #INDENT# continue #NEWLINE# #UNINDENT# val += '\r\n' #NEWLINE# if ( f . name in [ 'Method' , 'Additional-Headers' , 'Status-Line' ] ) : #NEWLINE# #INDENT# p = f . addfield ( obj , p , val ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# p = f . addfield ( obj , p , ( '%s: %s' % ( f . name , val ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# return p