postman

Django Rest Framework – invalid credentials – can not Login via Postman

Django Rest Framework – invalid credentials – can not Login via Postman Question: I’m working on web app where you can register and login via Postman. Register is working fine. Here is serializer.py from rest_framework import serializers from django.contrib.auth.models import User from rest_framework_simplejwt.tokens import RefreshToken from django.contrib.auth import authenticate class RegisterSerializer(serializers.Serializer): first_name = serializers.CharField() last_name …

Total answers: 1

Python -Rest API to fetch the bearer – Requests module

Python -Rest API to fetch the bearer – Requests module Question: I have an API, where I need to get the bearer token. When I use ‘Postman’ application, I get the bearer token correctly. I have written below python code for the same but I get below errors. Please help. I need to send username …

Total answers: 1

Python request to retrieve all requests from Postman collection

Python request to retrieve all requests from Postman collection Question: I need to print all requests from specific Postman collection. I have this code: import requests # Set up Postman API endpoint and authorization postman_api_endpoint = "https://api.getpostman.com/collections" postman_api_key = "PMAK-63b6bf724ebf902ad13d4bf2-e683c12d426716552861acda**********" headers = {"X-Api-Key": postman_api_key} # Get all requests from Postman collection collection_id = "25184041-c1537769-f598-4c0e-b8ae-8cd185a79c03" response …

Total answers: 1

Value is not a valid dict when posting JSON data through Postman to FastAPI backend

Value is not a valid dict when posting JSON data through Postman to FastAPI backend Question: @app.post("/posts") def post_req(payload: dict = Body(…)): print(payload) return {"Message": "Posted!!!"} I am using the above path operation function to receive POST requests, but when I am trying to make a request using Postman, it says value is not a …

Total answers: 3

Using a pyJWT expiration time

Using a pyJWT expiration time Question: I’m working on a small project. I have a teacher’s decorator. With the JWTs I produce on the login page, it is allowed to enter different roots. I want to generate JWTs with an expiration time. But there is a problem I can see the expiration time in Postman, …

Total answers: 1

Flask SQLAlchemy,Postman returns a single data

Flask SQLAlchemy,Postman returns a single data Question: When ı run this code in VSCode: table_name = ‘student’ query = f’SELECT * FROM {table_name}’ result = db.session.execute(query) for elem in result: print(dict(elem)) It prints every data in the table. But when I try it in Postman with return and GET method: table_name = ‘student’ query = …

Total answers: 1

RavenPack API_key is working in postman but NOT in python code

RavenPack API_key is working in postman but NOT in python code Question: I am tryin to work with this repo https://github.com/RavenPack/python-api Weirdly enough, the API is working perfectly with POSTMAN (it’s a tool used to automate testing API development and HTTP calls) Here’s the code snippet from ravenpackapi import RPApi from ravenpackapi import Dataset api …

Total answers: 2