https://thinkster.io/tutorials/testing-backend-apis-with-postman/customizing-requests-in-postman
我正在实现一个有关 thinkster 的教程,用于学习 postman 。他们有一个测试站点来运行他们的请求,并且有以下 URL 来测试登录功能:
https://conduit.productionready.io/api/users/login
我位于“将您的帐户凭据放入 POST 请求正文中”部分。我已经在测试站点上创建了一个帐户,并且可以从站点本身正确登录。但是当我通过 postman 以原始模式发送具有以下正文的请求时:
{"user":{"email":"<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="63061b020e130f0623050208064d000c0e" rel="noreferrer noopener nofollow">[email protected]</a>", "password":"nopassword"}}
我在漂亮模式下得到以下响应:
{
"errors": {
"email or password": [
"is invalid"
]
}
}
谁能告诉我我做错了什么或者他们是否从这个网站得到了正确的回应?
最佳答案
以防万一其他人需要此问题的解决方案。
In the Body tab of the request editor, select the
raw
option, and then selectJSON
in the dropdown that appears to the right of the options.
关于http-post - Thinkster postman 教程帖子请求登录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43704529/