/azjson

just for fun

Primary LanguageGoMIT LicenseMIT

Go Report Card Go Reference Github Actions

azjson

Simple library for working with APIs with Azure AD authentication.

Examples

type response struct {
  ID   string `json:"id"`
  Name string `json:"name"`
}

func main() {
  var responseJSON response
  token := azcore.AccessToken{}

  res, err := GetJSON("https://example.com", token)
  if err != nil {
  	fmt.Println(err)
  }

  jsonErr := json.Unmarshal([]byte(companyRes), &responseJSON)
  if jsonErr != nil {
  	fmt.Println(jsonErr)
  }
}