C
C
cat_crash2017-01-27 00:16:58
JavaScript
cat_crash, 2017-01-27 00:16:58

How to get data through Ajax request and bypass CORS?

Dear editors, help me, unfortunate, to find the answer to my question
. I have a piece of iron on the Arduino that controls the bus and, as an API, an HTTP interface is brought out, which gives statuses in plain text
. There is not the slightest possibility to flash or somehow touch the Arduino.
Actually, my problem - when I send AJAX requests from plain html, I return CORS errors
. Is it possible to somehow bypass this limitation with client-side settings (set meta tags, etc.?) given that all I need is to read a plain-text response and then parse it with a regular expression?
The option to raise the proxy is not an option due to the specificity of the case

Answer the question

In order to leave comments, you need to log in

2 answer(s)
Дмитрий Беляев, 2017-01-27
@cat_crash

Если нет возможности вмешаться в формат ответа железки (Добавить cors заголовки или обернуть тело в jsonp), то единственный вариант - это проксировать запросы к железке через тот же домен, на котором вебморда

Рустамка Воронцов, 2017-01-27
@rmfordev

https://coertvonk.com/technology/embedded/arduino-... не то? (JSONP)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question