test_repo_javishub's People
test_repo_javishub's Issues
can i change the headers['content-type'] before a get request?
test
test
test
test
can i change the headers['content-type'] before a get request?
test
Error 201
How the ` promise. All ` capture in the wrong?
Summary
I sent several requests, unified handling errors in the interceptor, when I use a promise.all () to send multiple requests, Multiple error prompts are output, whether can unified processing in the interceptor promise.all () the response?
`
ajax.interceptors.response.use((response) => {
if (response.data.access_token) {
Cookies.set('bear', response.data.access_token);
Cookies.set('refresh_bear', response.data.refresh_token);
Cookies.set('expires_in', response.data.expires_in);
Error 501
can i change the headers['content-type'] before a get request?
teste 5
ALO ALO ALO TESTE TESTE TESTE
teste 3
can i change the headers['content-type'] before a get request?
some test
test
test
teste
teste
test
test
How do I intercept errors?
How do I intercept errors?
can i change the headers['content-type'] before a get request? #1647
our back api limit the request content-type must be an fixed value, even it's a get request.
but i see the source code will remove the content-type when request data is undefined,
so i set an empty data before request, like
if (!config.data) { config.data = "" }
then set the content-type . this will work well on IOS device; but crashed on android device,
it will throw an error,
GET must not have a request body
is there any solution to fix this problem? thanks~
How do I intercept errors?
How do I intercept errors?
Something wrong when response with code 400 in axios
I'm using Vue and Axios to build a SPA frontend. When server send a response with code 400 in CROS. Browser's console log:
(2) POST http://dev.sportx.one/api/token/ 400 (Bad Request) **This line logged twice**
Failed to load http://dev.sportx.one/api/token/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 400.
Error: Network Error
at e.exports (spread.js:25)
at XMLHttpRequest.l.onerror (spread.js:25)
How I send request:
api.request({
url: '/api/token/',
method: 'post',
data: {
email: '[email protected]',
password: 'aaaaaaaA'
}
}).catch(err=>{console.log(err)})
Browser's network inspector shows 2 requests(OPTIONS and POST) has been sent. The both of them are working as expected.
How ever if server send a 20X response without any error catches. Everything is fine.
I try the same code in a new html file and only load axios's script file. Got the same errors.
This question was copied from https://stackoverflow.com/questions/50133379/something-wrong-when-response-with-code-400-in-axios
How do I intercept errors?
How do I intercept errors?
can i change the headers['content-type'] before a get request?
can i change the headers['content-type'] before a get request?
asd
How the ` promise. All ` capture in the wrong? #6
Summary
I sent several requests, unified handling errors in the interceptor, when I use a promise.all () to send multiple requests, Multiple error prompts are output, whether can unified processing in the interceptor promise.all () the response?
`
ajax.interceptors.response.use((response) => {
if (response.data.access_token) {
Cookies.set('bear', response.data.access_token);
Cookies.set('refresh_bear', response.data.refresh_token);
Cookies.set('expires_in', response.data.expires_in);
How do I intercept errors?
How do I intercept errors?
teste
testeee
can i change the headers['content-type'] before a get request?
How do I intercept errors?
teste 4
Error 500
Something wrong when response with code 400 in axios
I'm using Vue and Axios to build a SPA frontend. When server send a response with code 400 in CROS. Browser's console log:
(2) POST http://dev.sportx.one/api/token/ 400 (Bad Request) **This line logged twice**
Failed to load http://dev.sportx.one/api/token/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:8080' is therefore not allowed access. The response had HTTP status code 400.
Error: Network Error
at e.exports (spread.js:25)
at XMLHttpRequest.l.onerror (spread.js:25)
How I send request:
api.request({
url: '/api/token/',
method: 'post',
data: {
email: '[email protected]',
password: 'aaaaaaaA'
}
}).catch(err=>{console.log(err)})
Browser's network inspector shows 2 requests(OPTIONS and POST) has been sent. The both of them are working as expected.
How ever if server send a 20X response without any error catches. Everything is fine.
I try the same code in a new html file and only load axios's script file. Got the same errors.
This question was copied from https://stackoverflow.com/questions/50133379/something-wrong-when-response-with-code-400-in-axios
teste 2
How do I intercept errors?
How do I intercept errors?
test
test
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.