New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chrome & CORS #1
Labels
--disable-web-security
--disable-web-security
Chrome & CORS & Proxy
Chrome & CORS & Proxy
Chrome & CORS
Chrome & CORS
Comments
CORS componentDidMount() {
// 'Access-Control-Allow-Origin' header
// set the request's mode to 'no-cors'
// const url = `http://10.1.5.31:8081/http/manage/admin?{"Admin":"report","Action":"GetAllLoad","WriteType":"json"}`;
const url = `http://localhost:7777/info/`;
const init = {
method: 'GET',
headers: {
'Accept': 'application/json',
"Access-Control-Allow-Origin": "*",
'Content-Type': 'application/json'
},
mode: 'no-cors'
};
const request_url = new Request(url, init);
fetch(request_url)
.then((response) => response.json())
.then((json)=> {
console.log(`json = ${json}`);
console.log(`json.length = ${json.length}`);
/* json = json.Info;
console.log(`json.Info = ${json.Info}`);
console.log(`json.Info.length = ${json.Info.length}`); */
const datas = json.map(
(data) => {
console.log(`data`, data)
return data;
}
);
console.log(`datas = ${JSON.stringify(datas)}`);
return datas;
})
.then((datas)=> {
console.log(`datas new = ${JSON.stringify(datas)}`);
return this.setState({
datas: datas
});
});
} |
|
chrome://chrome-urls/https://www.cnblogs.com/laden666666/p/5544572.html chrome://flags/ |
--disable-web-security
|
CORS All In One |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
--disable-web-security
--disable-web-security
Chrome & CORS & Proxy
Chrome & CORS & Proxy
Chrome & CORS
Chrome & CORS
Chrome & CORS
https://www.cnblogs.com/xgqfrms/
http://www.cnblogs.com/xgqfrms/p/8327473.html
http://www.cnblogs.com/linda586586/p/4351452.html
The text was updated successfully, but these errors were encountered: