Python实现签名去除字典中的键值对的冒号后的空格方法
最近遇到一个比较怪的签名方式,先采用了正则匹配,发现不行。之后发现使用字符串的replace方法可以实现。
代码实例
import collections
from hashlib import md5
import json
pramrs = {
"action": "wanyilian.distributor.order.create",
"app_key": "rebecca",
"data": {
"address1": "1 Stafford Crt.",
"address2": "aaaaaaa",
"city": "Bayswater North",
"doorplateNumbers": "109",
"emailAddress": "abc@winit.com",
"phoneNum": "15900001111",
"packageList": [{
"packageNo": "",
"warehouseCode": "US0003",
"deliveryWayCode": "OSF1010520",
"authBarcode": "",
"eBayOrderID": "3434245-24377766",
"productList": [{
"eBayBuyerID": "98877456rere&#