S
S
saqo_tadevosyan2020-07-20 09:42:34
JavaScript
saqo_tadevosyan, 2020-07-20 09:42:34

Error when sending a request to VK?

let group_id = "gruopid"; 
 let v = '5.120' 
 let url = 'https://api.vk.com/method/groups.getById?access_token=myAccsessKey' + '&v=' + v + '&group_id=' + group_id + '&fields=description,has_photo' //And more fields 
 
 fetch(url).then(result=>{ 
 console.log(result.json()) 
 })


When I send this request, I get the following error
Access to fetch at 'https://vk.com/' (redirected from 'http://vk.com/') from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

How to decide?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2020-07-20
@Seasle

Have you tried this?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question