The following code snippet is an example API. ![]() We can also test APIs which require the user to be logged in.įor example, we have an API used to query user data with the verifySession middleware as shown below Postman environment configuration GraphQL resources Prerequisites Using the GraphQL Playground REST and Document API resources Using the Swagger UI. More information about these cookies can be found here 2. You can see the session tokens set by the response by switching to the cookies tab Some API engineers already use Postman to work on endpoints without relying on a front-end UI to simulate API requests. On a successful request, a new user session will be created, with the user object and session tokens being returned in the response. ![]() This can be overridden by backend settings, but it's respected by default.Īdd the request JSON object to the body tab as shown in the image below This will advise the backend that you prefer cookie-based sessions. In the Header tab, set key st-auth-mode with value cookie. In the Header tab, set key rid with value emailpassword. Set the body of the request to be raw JSON. Along with user interface testing and feature testing, confirming your apps API works as it should is integral to the successful launch of your product. In Postman, set the request type to POST. Postman is a testing platform for developing, testing, and documenting APIs. We will test the /auth/signup API by creating a user with an email as and password as testPass123. You do not need to do this in your frontend code since our SDK does this for you. Mailman Suite refers to the collection of related Mailman projects that provide all the pieces of a typical mailing list management setup. This can be enabled by adding the "st-auth-mode: cookie" request header during the sign up API call as shown below. Request Trim keys and values in request body - Turn this on to trim parameters when sending requests with form data or url-encoded data. ![]() We recommend using cookie-based sessions while testing with Postman, to make use of the built-in cookie manager. About General Use the settings on the General tab to configure how Postman sends requests or to customize the Postman user interface. About General Use the settings on the General tab to configure how Postman sends requests or to customize the Postman user interface.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |