getFields :: Wreq.Options -> URI -> IO [FieldDescription]
getFields options host = do
  debug $ printf "Fetching field descriptors from %s..." url
  response <- Wreq.getWith options url >>= asJSON
  return $ response ^. responseBody
  where
    url = uriToString id absoluteUrl ""
    absoluteUrl = host
      { uriPath = "/rest/api/2/field"
      }
getFields :: Wreq.Options -> URI -> IO [FieldDescription]
getFields options host = do
  debug $ printf "Fetching field descriptors from %s..." url
  response <- Wreq.getWith options url >>= asJSON
  return $ response ^. responseBody
  where
    url = uriToString id absoluteUrl ""
    absoluteUrl = host
      { uriPath = "/rest/api/2/field"
      }
getFields options host = do
  debug $ printf "Fetching field descriptors from %s..." url
  response <- Wreq.getWith options url >>= asJSON
  return $ response ^. responseBody
  where
    url = uriToString id absoluteUrl ""
    absoluteUrl = host
      { uriPath = "/rest/api/2/field"
      }