debugtalk.py
558 Bytes
from requests_toolbelt import MultipartEncoder
import requests
def get_data(name,phone,map_address,longPoint,latPoint,filePath,imagePath):
m = MultipartEncoder(
fields={
'name': name,
'phone': phone,
'map_address': map_address,
'long': longPoint,
'lat': latPoint,
'file': ('file', open(filePath, 'rb'), 'image/jpeg'),
'image': ('image', open(imagePath, 'rb'), 'image/jpeg')
}
)
return m
def get_content_type(data):
return data.content_type