Last active
August 29, 2015 14:23
-
-
Save HarishAtGitHub/c2fd954f377a895473c5 to your computer and use it in GitHub Desktop.
interim server to communicate to cors unsupported server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## | |
# README: | |
# 1. pip install Flask | |
# 2. pip install flask-cors | |
## | |
from flask import Flask | |
from flask import request | |
import requests | |
from flask_cors import * | |
app = Flask(__name__); | |
@app.route('/orc', methods=['POST']) | |
@cross_origin() | |
def interim(): | |
custom_headers = { | |
'Accept': 'application/json' | |
}; | |
orc_response = requests.post("https://cors-unsupported-server", | |
data = request.form.keys()[0], | |
headers = custom_headers); | |
return orc_response.content; | |
app.run(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment