Questions tagged [flask-restful]

Flask-RESTful provides an extension to Flask for building REST APIs. Flask-RESTful was initially developed as an internal project at Twilio, built to power their public and internal APIs.

Project repo is maintain on Github currently.
The latest document is here
Its pypi info can be find here

1619 questions
0
votes
1 answer

Webservice - RESTful API, Python, Raspberry pi, iOS

I have a python script that take image using raspberry pi and update a JSON file with id and image URL, which is consumed by an iOS app.(Read Directly the JSON file) I need a web service that parse the JSON and provide me with only image that is…
moz ado
  • 490
  • 4
  • 17
0
votes
2 answers

How switching to another web page jquery flask

I made a script that allows a user to login I used python flask microframework jquery but the problem that if I filled the fields user and password it will not have a passage to another page which I have already specified in the method if the data…
kaio
  • 131
  • 1
  • 10
0
votes
1 answer

How do I prevent having to fill in parameter names in flask-restful?

I am making an extremely simple API using flask-restful and want to process POST-parameters without having to require the users to enter a parameter name, e.g. curl -d "data" localhost instead of curl -d "name=data" localhost The API is used…
svdc
  • 154
  • 2
  • 10
0
votes
1 answer

Per-method routes on flask-restful

I'm building a RESTful API using flask-restful and have run into a small issue. Essentially, I need to ensure that certain methods only work if a required parameter is provided, while certain others work only if a parameter is not provided. For…
Chinmay Kanchi
  • 62,729
  • 22
  • 87
  • 114
0
votes
2 answers

How to access nested resources in Flask-Classy?

I've been using Flask-Classy for my server, and it works great. However, I've come across a use case that I haven't seen written about, but it's a pretty common use case, so I'd be shocked if it's not possible. I have two APIs which I want to nest,…
SJoshi
  • 1,866
  • 24
  • 47
0
votes
1 answer

API Error 500 with Flask and Apache

I'm trying to get my API to work on my Ubuntu VPS using Apache, this is my FLASK code; #!/usr/bin/env python import os from sqlalchemy import update from flask import Flask, abort, request, jsonify, g, url_for from flask.ext.sqlalchemy import…
Sean Downey
  • 25
  • 1
  • 5
0
votes
1 answer

Error 404 in flask rest api in python

I am new to flask Restful api i am trying to make a rest api which get JSON data.While entering the curl command i get the 404 error.Here is the code can anyone please help. #flask/bin/python from flask import Flask, jsonify, abort, request,…
0
votes
1 answer

Python Flask SQLalchemy JSON POST Error

I'm trying to post the following JSON and save to a MySQL database on a Flask server and Python 2.7, restless framework and SQLAlchemy with curl: curl -i -H "Accept: application/json" -X POST -d '{"attribute_id": "1", "product_id":…
Seroney
  • 805
  • 8
  • 26
0
votes
1 answer

Using JSONP with flaskr and javascript

I'm using Flaskr to generate data via a RESTful API. My call looks like: http get localhost:5000/v1.0/dataset dataset_id==f7e7510b3c1c4337be339446ca000d22 and returns something like: {"sites": "a"} Now I'm tring to fetch this data with my web app.…
marc
  • 2,037
  • 9
  • 24
  • 32
0
votes
1 answer

Developing an error handler as a decorator in flask-restful

I'm trying to develop a rest api by flask-restful. The following decorator is implemented: def errorhandler(f): @wraps(f) def wrapper(*args, **kwargs): try: return f(*args, **kwargs) except errors.DocNotFound: …
Birish
  • 5,514
  • 5
  • 32
  • 51
0
votes
1 answer

Testing authenticated endpoints in Flask

I have a Flask application using LDAP for authentication, with several endpoints managed with flask-restful, but I want to unit test authenticated endpoints without actually hitting the LDAP server. I was hoping to do this by faking flask-login's…
Ray Toal
  • 86,166
  • 18
  • 182
  • 232
0
votes
1 answer

Restful Flask Python

I am new to python and flask, trying learning by building a restful customer database, so this is in dataModels.py: very plain: class Customer(object): def __init__(self, pID, name, address, email, custNO, agent ): self.pID = pID …
emraldinho
  • 475
  • 8
  • 23
0
votes
1 answer

restrict allowed arguments using flask-restful

flask-restful has a useful request parser with which one can declare required and optional arguments in various request locations such as the query string or in json content. Arguments that are not declared are ignored by the parser. Is there a way…
Jonathan Livni
  • 101,334
  • 104
  • 266
  • 359
0
votes
1 answer

How to add fields url for nested output fields in flask restful

I am having difficulty over generating api endpoint urls in nested output fields using [Flask-RESTful][1]. I found that fields.Url('my_endpoint', absolute=True) only generates url inside top url fields not the nested one. It throws…
Vivek R
  • 666
  • 7
  • 20
0
votes
1 answer

Generating documentation for flask extensions using sphinx

I am attempting to generate documentation for flask-restfulan extension for flask that makes it easy to generate RESTful APIs. My final goal is to use doc2dash to generate dash doctests. However, before I can do this, I need to generate the html…
Games Brainiac
  • 80,178
  • 33
  • 141
  • 199
1 2 3
99
100