Skip to content

Instantly share code, notes, and snippets.

View gracemcgrath's full-sized avatar

Grace gracemcgrath

  • CCNY
  • New York
  • 08:51 (UTC -04:00)
View GitHub Profile
## Bugs
1. After installing gin dependencies on my computer, I ran into this bug when trying to run the main.go file:
```main.go:6:3: no required module provides package github.com/gin-gonic/contrib/static: go.mod file not found in current directory or any parent directory```
@gracemcgrath
gracemcgrath / sample-app.py
Created January 9, 2020 19:45
Winterns2020: sample python API requests
from flask import Flask, render_template
import requests, json
app = Flask(__name__)
@app.route("/api-explorer", methods=['GET', 'POST'])
def makeRequest():
response = requests.post('https://api-ssl.bitly.com/v4/bitlinks', json={"long_url":"https://dev.bitly.com/v4/#operation/getBitlinksByGroup"},headers={'Authorization': 'Bearer <ACCESS_TOKEN>'})
print("My new bitlink: " + json.loads(response.text)["link"])