Get authenticated user
Find yourself they say. That’s what you can do here.
curl -X GET "https://galaxy.scalar.com/me"
fetch("https://galaxy.scalar.com/me")
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://galaxy.scalar.com/me"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://galaxy.scalar.com/me"
response = requests.request("GET", url)
print(response.text)
{
"id": 1,
"name": "Marc"
}
{
"type": "https://example.com/errors/not-found",
"title": "Unauthorized",
"status": 401,
"detail": "You are not authorized to access this resource."
}
{
"type": "https://example.com/errors/forbidden",
"title": "Forbidden",
"status": 403,
"detail": "You are not authorized to access this resource."
}
How is this guide?