How do you force a web browser to use POST when getting a url?

前端 未结 11 2599
别跟我提以往
别跟我提以往 2020-12-14 00:16

How do you force a web browser to use POST when getting a url?

相关标签:
11条回答
  • 2020-12-14 00:37

    I know this question is old but someone may find this useful. You can use a command line tool like cURL (http://curl.haxx.se/) to post to a URL.

    Example:

    curl -v  --basic --user username:password --request POST "http://www.theurltopostto.com"
    
    0 讨论(0)
  • 2020-12-14 00:38

    you can not force any web browser to send the url with POST header. But to test a POST request url , I can suggest "POSTER" extention of chrome and mozilla

    0 讨论(0)
  • 2020-12-14 00:38

    The utility "Fiddler" by Telerik (free ware) allows you to "compose" an http request and send it using any method you choose (Get, Post, Put, Del, etc) It also will give you some very detailed information about the request and the response that can be very helpful during testing and debugging

    0 讨论(0)
  • 2020-12-14 00:39

    I have a feeling from your question you were just hoping to send a post request in a browser's address bar.

    Just type the following into the address bar swapping the value for 'action' to the url that you like.

    data:text/html,<body onload="document.body.firstChild.submit()"><form method="post" action="http://stackoverflow.com">
    

    It's invalid html, but the browser's (at least all the ones i've tested it in so far) know what you mean, and I wanted to keep it as short as I could.

    If you want to post values, append as many inputs as you like, swapping name and value in each input for whatever you like.

    <input value="hugh.mahn@person.com" name="email">
    <input value="passwordsavedinhistory" name="password">
    

    It's important to note that sensitive information you post will be visible in:

    • your history
    • your address bar
    • your browser's autocomplete.
    • possibly other sites that you visit from the same tab
    • probably plenty of other things too

    It's a really bad way to send a post request, and all the other answers are far better, but it's still cool that you can do it.

    0 讨论(0)
  • 2020-12-14 00:44

    You can use a tool to test. I'm always asking the same question as you. There is quite a few tools available online. Here is the tool that I use: http://www.hurl.it/

    0 讨论(0)
提交回复
热议问题