package api

import (
	"fmt"
	"log"
	"net/http"
)

const apiURL string = "https://api.onedrive.com/v1.0/"

var client *http.Client

func init() {
	c, err := getClient()
	if err != nil {
		log.Fatal(err)
	}
	client = c
}

// GetDriveInfos return the content length of the /drive/ api entry point
func GetDriveInfos() string {
	resp, err := client.Get(fmt.Sprintf("%s/drive/", apiURL))
	if err != nil {
		log.Fatalln(err)
	}
	return fmt.Sprintf("Status: %d-%s\n", resp.StatusCode, resp.Status)
}

package api

import (
	"fmt"
	"log"
	"net/http"
)

const apiURL string = "https://api.onedrive.com/v1.0"

var client *http.Client

func init() {
	c, err := getClient()
	if err != nil {
		log.Fatal(err)
	}
	client = c
}

// GetDriveInfos return the content length of the /drive/ api entry point
func GetDriveInfos() string {
	driveURI := fmt.Sprintf("%s/drive/", apiURL)
	log.Printf("Request: %s\n", driveURI)
	resp, err := client.Get(driveURI)
	if err != nil {
		log.Fatalln(err)
	}
	return fmt.Sprintf("Status: %s\nContentLength: %d", resp.Status, resp.ContentLength)
}

Correct URI for the API
Correct URI for the API
