Z
Z
zorro32022-01-22 16:43:38
JavaScript
zorro3, 2022-01-22 16:43:38

Why am I getting a 302 code in response to a request?

Why am I getting a 302 code in response to a request, can I somehow fix it?

Request method:

const grabApps = async () => {
  const res = await fetch(`${spinnakerURL}/gate/applications`, {
    mode: 'no-cors',
    redirect: 'follow',
  })
  console.log(res)
  return res.data || []
}


vue.js.config

module.exports = {
    devServer:
        {
            proxy:
                {
                    '/gate':
                        {
                            target: 'https://spinstatus.zenoss.io',
                            changeOrigin: true,
                            onProxyReq: (proxyReq, req, res, options) =>
                            {
                                proxyReq.setHeader('Origin', 'https://spinstatus.zenoss.io')
                            }
                        }
                }
        }
}


61ec09b99e3bb749267792.jpeg- response applications query
61ec09d5adabd867575307.jpegheaders of applications query

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question