Import Requests Import json Data = { ' A ' : 123 , ' B ' : 456 } # headers added to the content-type this parameter is specified as json format headers = { ' the Content-the Type ' : ' file application / json ' } # the packet format is converted into json Response = requests.post (URL = ' URL ' , headers = headers, json.dumps = data (data))