user354134
user354134

Reputation:

URL shortening with POST data

Many services (eg, bit.ly) will shorten URLs, even those w/ GET data, since that's just part of the URL.

Do any work w/ POST data? In some cases (eg, certain types of CBOE option quotes), you must POST data to get the information you want.

The service might bring up a page (eg, shorten.com/foo) that has:

<form action="/url/to/post/to"> 
<input type="hidden" name="var1" value="val1"> 
... 
<input type="submit" value="SUBMIT"> 
</form> 

where the /url/to/post/to and var1/val1/etc are set by the person creating the shortened URL. It would also say:

"By pressing the button below, you will post this data to this URL: /url/to/post/to: [list of hidden fields and values]"

Seems useful and easy to do... has anyone done it?

Upvotes: 2

Views: 2506

Answers (3)

tuffo19
tuffo19

Reputation: 338

Now I found a way to use a GET request to trigger a POST request. I used zapier.

enter image description here

you create a webhook to use as a trigger (it generates a link like this: https://hooks.zapier.com/hooks/catch/xxx/yyy/)

and you configure a new webhook as action. The action can be a POST request, with header, parameters and so on.

I used it to generate a URL to trigger my shelly to open the gate at home.

ask me more if you need more details.

Upvotes: 0

user354134
user354134

Reputation:

OK, this seems to have degenerated into a moral argument. I'll assume the answer is no, no one has already done this.

Upvotes: 2

nate c
nate c

Reputation: 9005

I see two big problems:

Who is going to copy / paste the form (often generated by javascript) - Regular users? It would only be open to people with enough technical competence to do it. And it may not do not have the intended effects since some data may be in cookies or held server-side.

Also, post requests are not usually considered an open api for anyone to use. Usually, data is built up over a series of steps with possible use of cookies and login information. Websites are not going to be happy with letting people delete their account or bypass certain pages that are in the normal process flow.

Upvotes: 0

Related Questions