Changeset 14 for bin/bletchley-http2py


Ignore:
Timestamp:
11/23/12 14:44:07 (12 years ago)
Author:
tmorgan
Message:

better script formatting for large bodies
default to port 80

File:
1 edited

Legend:

Unmodified
Added
Removed
  • bin/bletchley-http2py

    r4 r14  
    7979
    8080host = 'TODO'
    81 port = 0
     81port = 80
    8282use_ssl = False
    8383
     
    120120''' % (repr(host),repr(port),repr(use_ssl)))
    121121
     122chunked_body = '\n            '.join([repr(body[i:i+40]) for i in range(0,len(body),40)])
     123
    122124print('''
    123125def sendRequest(connection):
    124126    method = %s
    125127    path = %s
    126     body = %s
    127 
     128    body = (%s)
     129   
    128130    connection.putrequest(method, path)
    129     ''' % (repr(method), repr(path), repr(body)))
     131    ''' % (repr(method), repr(path), chunked_body))
    130132
    131133for name,values in headers:
Note: See TracChangeset for help on using the changeset viewer.