小编mkb*_*b79的帖子

Postman:使用 SHA256 和 RSA 自定义签名请求

我编写了一个接口,用 python 向内部音频 api 发出请求。每个 API 请求都需要使用 RSA SHA256 进行签名。

现在我想用 Postman 测试 API 的端点并利用预请求脚本功能。但我对 javascript 并不坚定。也许有人可以帮助我将以下 python 函数翻译为 Postman 脚本:


def sign_request(
    request: httpx.Request, adp_token: str, private_key: str
) -> httpx.Request:
    """
    Helper function who creates a signed requests for authentication.

    :param request: The request to be signed
    :param adp_token: the token is obtained after register as device
    :param private_key: the rsa key obtained after register as device
    :returns: The signed request
    """
    method = request.method
    path = request.url.path …
Run Code Online (Sandbox Code Playgroud)

javascript python sign postman

1
推荐指数
1
解决办法
2万
查看次数

标签 统计

javascript ×1

postman ×1

python ×1

sign ×1