Skip to content

Instantly share code, notes, and snippets.

@ryonagana ryonagana/request
Created Apr 14, 2019

Embed
What would you like to do?
from flask import Flask
import json
import urllib.request
app = Flask(__name__)
@app.route('/')
def hello_world():
r = urllib.request.urlopen('https://www.alphavantage.co/query?function=TIME_SERIES_INTRADAY&symbol=VALE3.SA&interval=5min&apikey=PN6ZAMT6VK4BZTFU')
response_text = r.read.
return app.response_class(
response= r.read().encode('utf-8'),#r.text,
status=200,
mimetype='application/json; charset=UTF-8'
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.