user1174838
user1174838

Reputation: 323

Do REST POST action from within HTML

Further to https://stackoverflow.com/questions/16726368/apache-user-auth-and-redirection-based-on-remote-user, I need to do some POSTs to the REST API but I'm struggling on how to implement.

I need to do the equivilent of:

/usr/bin/curl -s X POST -H "Accept: application/xml" --cacert ca.cer -u user@domain:password -d "<action />" https://server:port/api/id/stop

in just plain HTML.

Any ideas?

Upvotes: 0

Views: 64

Answers (1)

Quentin
Quentin

Reputation: 944158

No feature of HTML will allow you to construct a request in which you:

  • Override the browser's Accept header
  • Specify an certificate to use instead of the browser's library of them
  • Specify HTTP auth (at least cross browser, some may still accept URIs in the form http://foo:[email protected]) or
  • Make a POST request with XML as the body

You could specify some of that using JavaScript/XHR, but not with "just plain HTML".

Upvotes: 2

Related Questions