Answer the question
In order to leave comments, you need to log in
Is it possible to redirect a POST request with Form-Data from a site to GitHub pages?
The task is as follows:
1) There is a website https://mysite.com deployed on GitHum pages (the domain is bound in CName)
2) There is an application with a back-end on node.js https://api.mysite.com deployed on AWS С2
3) There is a certain "Resource", the API of which notifies my site about any events.
And here's the catch:
This "Resource" at https://mysite.com sends a GET or POST method request containing the information I need in form-data. But I need this request on the api.mysite.com endpoint, and subdomains like https://api.mysite.com are not accepted. If the site were "lying" on a regular hosting, I would catch a resource request at https://mysite.com/endpoint.phpand send it to the desired https://api.mysite.com/endpoint/ . But what about GitHub pages? Is it possible to make a redirect pointing to the resource https://mysite.com/redirect.html ?
Answer the question
In order to leave comments, you need to log in
I didn't quite understand the question, but maybe this will help you:
var original = {
open: XMLHttpRequest.prototype.open,
send: XMLHttpRequest.prototype.send
};
XMLHttpRequest.prototype.open = function (method, url, async, user, password) {
console.log(url);
return original.open.call(this, method, url, async, user, password);
};
XMLHttpRequest.prototype.send = function (data) {
console.log(data);
return original.send.call(this, data);
};
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question