# -*- coding: utf-8 -*-
# @Author: wangkun
# @Time: 2023/6/19
import requests

url = "https://kapi-xng-app.xiaoniangao.cn/v2/trends/recommend"

payload = "{\"topic_name\":\"recommend\",\"ext\":{\"current_item\":0,\"items\":[]},\"tag_id\":0,\"refresh\":false,\"share_width\":300,\"share_height\":240,\"staggered_style\":0,\"qs\":\"imageMogr2\\/gravity\\/center\\/rotate\\/$\\/thumbnail\\/!750x500r\\/interlace\\/1\\/format\\/jpg\",\"topic_id\":2,\"h_qs\":\"imageMogr2\\/gravity\\/center\\/rotate\\/$\\/thumbnail\\/!80x80r\\/interlace\\/1\\/format\\/jpg\",\"log\":{\"net\":\"wifi\",\"product\":\"xng\",\"uid\":\"2F310D09-5E32-5985-8644-3BCB6920E76F\",\"brand\":\"iPad\",\"page\":\"\",\"session_id\":\"71C77648-3224-4083-894C-B6282131F286\",\"resolution\":\"750*1334\",\"pf\":\"4\",\"app_version\":\"1.22.5\",\"device\":\"iPad Pro (12.9-inch) (3rd generation)\",\"os_version\":\"15.7\",\"idfa\":\"\",\"channel\":\"ios_app_store\"},\"token\":\"\"}"

headers = {
  'Host': 'kapi-xng-app.xiaoniangao.cn',
  'content-type': 'application/json; charset=utf-8',
  'accept': 'application/json',
  'authorization': 'PsrUTBCQ5G7UVZdgx+JxymPHcKU=',
  'verb': 'POST',
  'content-md5': '08fa0e6bf725fd6ef83c16d2ceb8a544',
  'x-b3-traceid': '45a6c5b4c471eecc',
  'accept-language': 'zh-Hans-CN;q=1.0',
  'date': 'Mon, 19 Jun 2023 09:47:40 GMT',
  'x-token-id': '',
  'x-signaturemethod': 'hmac-sha1',
  'user-agent': 'xngapp/1.22.5 (cn.xiaoniangao.xngapp; build:157; iOS 15.7.0) Alamofire/5.2.2'
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)