about summary refs log tree commit diff
path: root/monzo_ynab/monzo.go
blob: d27f65165620dee7b4e73f888e274466f8ba0cfa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package main

import (
	"fmt"
	"net/http"
)

// TODO: Support a version of this function that doesn't need the token
// parameter.
func monzoGet(token, string, endpoint string) {
	client := &http.Client{}
	req, err := http.NewRequest("GET", fmt.Sprintf("https://api.monzo.com/%s", endpoint), nil)
	failOn(err)
	req.Header.Add("Authorization", fmt.Sprintf("Bearer %s", token))
	res, err := client.Do(req)
	failOn(err)
	fmt.Println(res)
}