分享一个某电商平台的if_none_match验证

分享一个某电商平台的if_none_match验证

分析思维图:

在这里插入图片描述

PHP方式:

		$data = 'itemid="商品id".&shopid="店铺id"';
        $match_n = md5(utf8_decode($data));
        $match_b = '55b03'.$match_n.'55b03';
        $match_non = "55b03-".md5(utf8_decode($match_b));

python方式:

import hashlib

data = 'itemid="商品id".&shopid="店铺id"'
str_Request = '' + '55b03' + hashlib.md5(data.encode(encoding='UTF-8')).hexdigest() + '55b03'
if_none_match = '55b03-' + hashlib.md5(str_Request.encode(encoding='UTF-8')).hexdigest()
print(if_none_match)

生成如下:
在这里插入图片描述

过了这个验证再取它的数据就很简单了,当然嫌麻烦找我拿接口我不介意

猜你喜欢

转载自blog.csdn.net/weixin_52751465/article/details/114273279