-
Notifications
You must be signed in to change notification settings - Fork 0
/
solution1.py
30 lines (26 loc) · 947 Bytes
/
solution1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import urllib2
boundary='-------------------------7df3069603d6'
data=[]
data.append('--%s' % boundary)
data.append('Content-Disposition: form-data; name="app_id"\r\n')
data.append('xxxxxx')
data.append('--%s' % boundary)
data.append('Content-Disposition: form-data; name="version"\r\n')
data.append('xxxxx')
data.append('--%s' % boundary)
data.append('Content-Disposition: form-data; name="platform"\r\n')
data.append('xxxxx')
data.append('--%s' % boundary)
data.append('Content-Disposition: form-data; name="libzip"; filename="C:\Users\danwang3\Desktop\libmsc.zip"')
data.append('Content-Type: application/octet-stream\r\n')
fr=open('C:\Users\danwang3\Desktop\libmsc.zip')
content=fr.read()
data.append(content)
print content
fr.close()
data.append('--%s--\r\n'%boundary)
httpBody='\r\n'.join(data)
print type(httpBody)
print httpBody
postDataUrl='http://xxxxxxxx'
req=urllib2.Request(postDataUrl,data=httpBody)