Questions tagged [flask-restful]

Flask-RESTful is a powerful tool that extends the capabilities of Flask to easily create REST APIs. Originally conceived as an in-house project at Twilio, it was designed specifically to handle both public-facing and internal API needs for the company.

Unleashing the power of the Django API Rest Framework's POST method for data extraction

I am currently working on developing an API that will run a script using specific variables passed in the POST message, for example {'command': 'start', 'name': 'var'}. I have been struggling to find a way to extract ...

When using flask.jsonify, the output is wrapped in square brackets, as opposed to the usual curly

I'm currently facing an issue with my Flask and jsonify setup. When I try to output JSON, it's coming back in array format with square brackets instead of the expected JSON object with curly brackets. Does anyone have guidance on how to resolve ...

What are the potential risks of using a Python csv and StringIO to create an .xls file and how it could lead to

I have a React component that performs an AJAX call using Axios to connect to my own API and retrieve data in the form of an ".xls" file, which is then automatically downloaded. Everything works as expected, however, upon opening the .xls file, Excel displ ...

Retrieve another resource from the Flask API

I have developed a basic Flask API that returns a list of strings. Here is the code: from flask import Flask, request from flask_restful import Resource, Api from json import dumps app = Flask(__name__) api = Api(app) class Product(Resource): def ge ...

creating flask restful api with flexible endpoints and access control

Having recently started learning Flask, I have challenged myself to build my own API in order to become more proficient with the platform. Purpose of the API: Authenticated users should be able to access the endpoint www.mydomain.com/api/ and perform ...

The Flask CORS issue arises from the absence of the Access-Control-Allow-Origin header when using the redirect() function

I am currently working on setting up OAuth Twitter User-sign in using Flask API and Angular. Every time I click the sign in with Twitter button and a pop-up window opens, I encounter the following error message: XMLHttpRequest cannot load https://api.twi ...

Steps for importing the mongo variable from the app that is bound to the application

I have two files, app.py and views.py app.py from flask import Flask from flask_pymongo import PyMongo app = Flask(__name__) app.config["MONGO_URI"] = "mongodb://local:27017/local" mongo = PyMongo(app) from views import profileview profileview.register(ap ...