api 在 angular 项目中使用 postman 进行测试

api test with postman in angular project

我想测试我的 api 电阻,它是 post 输入包含用户名、电子邮件、密码、phone 号码。我真的不知道如何在 postman 中测试 api。应该是no-auth的授权类型。在此之后,我必须验证或测试 api 以进行登录,然后它会生成一些密钥,然后我必须使用此密钥来测试其他 api。

i believe to test post api withpostman
first you need to put the route of your api and the type of http in your case POST
then go to header tab and add this header(under key/value):-
Content-Type :application/json
then under body tab select row option and insert valid json as below
{
    "username": "Omar Shabro",
    "email": "o4@o.com",
    "phone": "0599"

}

取决于首先查找是否正在使用任何形式的身份验证,在这种情况下,您需要在发送请求之前处理身份验证。检查下面的 link 它会在 auth

的情况下帮助你

https://www.getpostman.com/docs/helpers