简体   繁体   中英

Fetch Instagram profile on search based

I want to fetch profile data by username-based search using ajax. I am getting cors error

Access to XMLHttpRequest at 'https://www.instagram.com/username?__a=1' from origin 'http://localhost' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.

在此处输入图像描述

I searched a lot add headers allow "Access-Control-Allow-Origin":"*" but not works.

在此处输入图像描述

what is wrong and how can i fix it?

The access control header has to be put on the server, not on the client. If you don't control the server, there's nothing you can do about this.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM