Joshua Meyers
Joshua Meyers

Reputation: 659

How can I force a form action to use an absolute URL?

I am using the following form on my website staticmantest.github.io:

<form class="js-form form" method="post" action="104.131.76.120:8080/v2/entry/StaticManTest/StaticManTest.github.io/master/reviews">

I intend a POST request to be sent to 104.131.76.120:8080/v2/entry/StaticManTest/StaticManTest.github.io/master/reviews. However, instead it is being sent to https://staticmantest.github.io/104.131.76.120:8080/v2/entry/StaticManTest/StaticManTest.github.io/master/reviews. What can I do to force this form action to be an absolute path?

Upvotes: 0

Views: 6189

Answers (1)

m1kael
m1kael

Reputation: 2851

Prefix you URL with

http://

so that it's

http://104.131.76.120:8080/v2/entry/StaticManTest/StaticManTest.github.io/master/reviews

Otherwise it's treated as a relative URL.

Upvotes: 5

Related Questions