We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Example usage: curl -u timski:FastForward4149 -F file=@yobot-4.6.2.noarch.rpm http://localhost/api/upload
Additions to requirements.txt:
Flask-HTTPAuth==2.2.1
Additions to init.py:
from flask import Flask, request, jsonify, make_response from flask.ext.httpauth import HTTPBasicAuth # Under app = auth = HTTPBasicAuth() # Under app.config @auth.get_password def get_password(username): if username == 'timski': return 'FastForward4149' return None @auth.error_handler def unauthorized(): return make_response(jsonify(message='Unauthorized Access', status=403), 403) #Under app.route /api/upload @auth.login_required