I'm working with a vendor who exposes an API that I can submit a POST request to with a multipart/form-data content type body. I provide three parameters and post them to the endpoint. The response is of type text/html and the body of the response is one big html page with CSS and JavaScript resources with relative file paths for these resources, like so...
<link href="/SelfServiceV3/css/site?v=UGJgWOWOr3HU-VqSuz-WTq16hygLTXMGIsn2PuMjStQ1" rel="stylesheet">
This resource will only load on the vendor's domain, not my domain where the request is made. The response has a 200 response code.
How can I consume this API through Javascript?
I'd like for users to click a button on the page and then through Javascript in the background, all of the three parameters get automatically sourced from different elements on the page, and then sent to this API which then responds with the HTML page that I want users to land on (the page returned by the API does not work in an i-frame or modal). I am unable to use any kind of redirect because I am not provided a URL by the response(other than the API endpoint that requires form data to be posted to it).