使用接口调试工具postman 请求描述 Python_requests请求格式HTTP请求格式 Code Block |
---|
| import requests
url = "http://test.birdsystem.com/POST /client/Product/"
payload="{\r\n \"#id\": 3027110,\r\n \"client_id\": 4790,\r\n \"name\": \"5G\",\r\n \"url\": \"5G\",\r\n \"name_customs\": \"5G\",\r\n \"material\": null,\r\n \"usage\":null,\r\n \"brand\": null,\r\n \"color\": null,\r\n \"model\": null,\r\n \"shape_type\": \"NORMAL_SHAPE\",\r\n \"customs_category_id\": null,\r\n \"customs_category_code\": null,\r\n \"return_action\": null,\r\n \"note\":\"5G建设\",\r\n \"client_ref\": \"4790-3027111\",\r\n \"commodity_code\": \"date\",\r\n \"is_need_to_record_sn\": 0,\r\n \" company_product-is_shared_internal\": 0,\r\n \"company_product-price\": 0.00,\r\n \"company_product-cost\": 0.00,\r\n \"price_customs_import\": 1.00,\r\n \"price_customs_export\": 0.2,\r\n \"sales_price\": 10,\r\n \"company_product-low_stock_level\": 0,\r\n \"inventory_time\": 0,\r\n \"dynamic_warehouse_stock_sequence\": \"DYNAMIC_WAREHOUSE_STOCK_FIRST\",\r\n \"combobox-1452-inputEl\": 50\r\n}"
headers = {
'api_key': '${api_key}',
'compamy_id': '36',
'Content-Type': 'application/json',
'Cookie': 'PHPSESSID=g43q2u6egm3vudalg4caa0e606'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.json)/ HTTP/1.1
Host: {{Bird_URL}}
Headres:
api_key: {{api_key}}
company_id: {{company_id}}
Cookie: PHPSESSID=3s3nejv43u9bhirsrvq9nge254
Body
raw
{"name":"测试产品",
"name_customs":"test product",
"customs_category_id":"1519",
"aterial":"plastic",
"usage":"test",
"brand":"test",
"color":"red",
"model":"test",
"url":"http://www.test.com/aaa",
"note":"测试测试",
"product_product_customs_property[]":9,
"#client_ref":"客户 SKU",
"client_ref":"{{$timestamp}}",
"weight":5,
"length":100,
"width":50,
"depth":20,
"description":"测试产品",
"price":5,
"cost":2,
"price_customs_import":5,
"price_customs_export":5,
"attachment_url":null} |
Json格式返回结果 Code Block |
---|
| {
"data": {
"price_internal": null,
"product_volume_level_code": null,
"product_stock_volume_level_code": null,
"product_sales_level_code": null,
"directional_share_total": null,
"total": null,
"price": null,
"cost": null,
"is_shared_internal": null,
"is_shared_external": null,
"client_dispatch_product_id": null,
"product_stock_level_code": null,
"company_id": null,
"warehouse_id": null,
"live_volume": null,
"sales_quantity": null,
"sales_volume": null,
"volume": null,
"id": 30271113055882,
"client_id": 4790,
"crossing_harbor_name_id": null,
"customs_clear_name_id": null,
"name": "5G测试产品",
"name_customs": "5Gtest product",
"material": "",
"usage": "test",
"brand": "test",
"url": "5Ghttp://www.test.com/aaa",
"color": null"red",
"model": null"test",
"country_of_origin": null,
"shape_type": "NORMAL_SHAPE",
"product_risk_level": "LOW",
"customs_value_level": "LOW",
"customs_category_id": null1519,
"commodity_code": "date"null, //商品报关编码
"note": "5G建设测试测试",
"description": null"测试产品",
"price_customs_import": "15.00",
"price_customs_export": "05.200000",
"price_customs_export_internal": "05.200000",
"sales_price": "10.00"null,
"handling_fee": "0.00",
"delivery_fee_adjustment": "0.00",
"client_ref": "4790-30271111621837201",
"company_ref": null,
"weight": "0.00",
"length": "0.00",
"width": "0.00",
"depth": "0.00",
"dimension_lock": "0",
"live_stock": "0",
"frozen_stock": "0",
"pending_stock": "0",
"low_stock_level": "0",
"inventory_time": "0",
"is_use_delivery_cost": "0",
"is_no_handling_fee": "0",
"is_vip": "0",
"is_dynamic_warehouse_unsalable_product": "0",
"is_need_to_record_sn": "0",
"last_info_check_time": null,
"last_stock_update_time": null,
"last_in_stock_time": null,
"last_out_stock_time": null,
"last_update_status_time": "2021-0305-1024 1514:4420:2701",
"create_time": "2021-0305-1024 1514:4420:2701",
"update_time": "2021-0305-1024 1514:4420:2701",
"note_internal": "",
"dynamic_warehouse_stock_sequence": "DYNAMIC_WAREHOUSE_STOCK_FIRST",
"return_action": null,
"status": "PREPARING",
"primary_keys": [
"id"
]
},
"success": true,
"moduleName": "client"
} |
|