I’m working on a CapCut-related website that provides tutorials, templates, and video resources. The site interacts with several APIs to fetch and display dynamic content, such as CapCut template lists and user-uploaded projects. I’m encountering a few issues with my API requests, particularly when testing them with Postman:
API Request Failures: Some requests, particularly those fetching CapCut project data, intermittently return a 504 Gateway Timeout error in Postman, even though they work fine in production. This happens with both GET and POST requests, especially when filtering by specific project categories or applying complex queries.
Authentication Issues: I’m using JWT tokens for user authentication. While the token is passed successfully in most requests, I’m seeing inconsistent 401 Unauthorized errors for some requests after users log in, even though the token appears valid in Postman’s Authorization tab.
Response Delays: Some requests with large datasets (e.g., user-uploaded CapCut templates) experience long response times when using Postman, but they are faster in production. I’ve tried adjusting the timeout settings, but the issue persists.
Data Formatting Errors: When testing responses for JSON data (like user profile or CapCut template info), I’m getting unexpected formatting issues, like missing fields or nested objects not appearing as expected.
Here’s my setup:
Backend: Node.js with Express, using JWT for authentication
API: RESTful API with POST and GET endpoints
Authentication: Bearer token used in the Authorization header
I’ve already tried:
Re-checking the token generation and expiration settings in Postman.
Testing different endpoints to isolate the problem.
Increasing the timeout settings for Postman requests.
Despite these efforts, I’m still encountering issues. Any advice on improving the reliability of my API requests in Postman or resolving the authentication and formatting problems would be greatly appreciated!