How to use the axios.head function in axios

To help you get started, weโ€™ve selected a few axios examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github phac-nml / irida / src / main / webapp / resources / js / components / session / SessionModal.jsx View on Github external
const keepSession = () =>
    axios.head(window.location.href).then(() => resetTimeout());
github madebymany / front-end-london / gatsby-node.js View on Github external
new Promise(resolve =>
      axios
        .head(url)
        .then(() =>
          axios
            .get(url, { responseType: "stream" })
            .then(({ data }) =>
              data.pipe(createWriteStream(path.join(imagePath, `${id}.jpg`)))
            )
            .then(() => {
              resolve(url)
            })
            .catch(e => {
              resolve(false)
            })
        )
        .catch(() => {
          resolve(false)
github DimaLiLongJi / InDiv / packages / common / http-client / index.ts View on Github external
public head(url: string, config?: HttpClientRequestConfig): Observable> {
    return from(axios.head(url, config));
  }
github pmg1989 / dva-admin / src / utils / request.js View on Github external
const fetch = (url, options) => {
  const { method = 'get', data } = options
  switch (method.toLowerCase()) {
    case 'get':
      return axios.get(url, { params: data })
    case 'delete':
      return axios.delete(url, { data })
    case 'head':
      return axios.head(url, data)
    case 'post':
      return axios.post(url, stringify(data))
    case 'put':
      return axios.put(url, stringify(data))
    case 'patch':
      return axios.patch(url, data)
    default:
      return axios(options)
  }
}
github trustwallet / trust-ray / src / controllers / AssestsController.ts View on Github external
public assetExists = async (assetName): Promise => {
        try {
            const response = await axios.head(this.getAssetFullPath(assetName))
            return response.status === 200;
        } catch (error) {
            winston.error(`Error checking file ${this.getAssetFullPath(assetName)} existence on S3`)
            return false
        }
    }
github jovotech / jovo-framework / jovo-core / src / HttpService.ts View on Github external
static head>(
    url: string,
    config?: AxiosRequestConfig,
  ): Promise {
    return axios.head(url, config);
  }
github iotaledger / documentation / buildProjects.js View on Github external
async function checkRemote(url) {
    if (checkRemotePages) {
        try {
            await axios.head(url);
        } catch (err) {
            if (err.message.indexOf('404') >= 0) {
                return 'Not found';
            } else if (err.message.indexOf('409') < 0) {
                return err.message;
            }
        }
    }
}
github pmg1989 / dva-admin / src / utils / request-mock.js View on Github external
const fetch = (url, options) => {
  const { method = 'get', data } = options
  switch (method.toLowerCase()) {
    case 'get':
      return axios.get(url, { params: data })
    case 'delete':
      return axios.delete(url, { data })
    case 'head':
      return axios.head(url, data)
    case 'post':
      return axios.post(url, data)
    case 'put':
      return axios.put(url, data)
    case 'patch':
      return axios.patch(url, data)
    default:
      return axios(options)
  }
}