% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/Require-helpers.R
\name{GETWauthThenNonAuth}
\alias{GETWauthThenNonAuth}
\title{GET a URL with a GitHub token, falling back to an unauthenticated request}
\usage{
GETWauthThenNonAuth(url, token, verbose = getOption("Require.verbose"))
}
\arguments{
\item{url}{The URL to GET.}

\item{token}{A GitHub token of the form \code{"token <pat>"}, or \code{NULL} for an
unauthenticated request.}

\item{verbose}{Numeric or logical, controlling messaging verbosity.}
}
\value{
The \code{httr} response object.
}
\description{
Signs the request with \code{httr::add_headers(Authorization = token)} when a
token is supplied, and retries without credentials if GitHub rejects them or
returns a 404. \code{token} must carry the \code{"token "} prefix that
\code{\link[=getGitCredsToken]{getGitCredsToken()}} produces -- a bare PAT authenticates nothing.
}
\details{
Exported for the SpaDES packages, which query the GitHub API for module
repositories and need the same authentication behaviour as \code{Require}. Not
part of the advertised API.
}
\keyword{internal}
