| 245 | return self._raw(url, timeout, options) |
| 246 | |
| 247 | def post_name(self, url, name, timeout=5, options=None): |
| 248 | reqbody = ("%s/nghttp.req.body" % self.TMP_DIR) |
| 249 | with open(reqbody, 'w') as f: |
| 250 | f.write("--DSAJKcd9876\r\n") |
| 251 | f.write("Content-Disposition: form-data; name=\"value\"; filename=\"xxxxx\"\r\n") |
| 252 | f.write("Content-Type: text/plain\r\n") |
| 253 | f.write(f"\r\n{name}") |
| 254 | f.write("\r\n--DSAJKcd9876\r\n") |
| 255 | if not options: |
| 256 | options = [] |
| 257 | options.extend([ |
| 258 | "--data=%s" % reqbody, |
| 259 | "-HContent-Type: multipart/form-data; boundary=DSAJKcd9876"]) |
| 260 | return self._raw(url, timeout, options) |
| 261 | |
| 262 | def upload(self, url, fpath, timeout=5, options=None): |
| 263 | if not options: |