debugtalk.py
644 Bytes
from requests_toolbelt import MultipartEncoder
import requests
import sys
import json
reload(sys)
sys.setdefaultencoding('utf8')
def get_data(**args):
fields = {}
for key in args:
if key == "image" or key == "file":
fields[key] = ("image", open(bytes(args[key]), "rb"), "image/jpeg")
else:
fields[key] = bytes(args[key])
m = MultipartEncoder(fields)
return m
def get_content_type(data):
return data.content_type
def get_orderid(content):
print("11111111111")
print content
print content[0]["id"]
orderid = int(content[0]["id"])
print orderid
return orderid