Skip to content

Tag: xmlhttprequest

How to format a string of html in json

I am working on a tool for generating html files. The code is fairly simple. A user clicks a post button and the content from a textarea is sent to an endpoint. I have tried posting the html as a json string. Expected The saveContent method is called. The value from the textarea element is concatenated into a…

Axios change http to https

I have server that accept only http (no https). And when I call an api, axios automatically change http to https. I create axios instance here: But in browser http changes to https, so it become: https://xxx.xxx.xxx/api/v1/all and I get net::ERR_NAME_NOT_RESOLVED How can I prevent that? UPDATE Request Header:…