Results 1 to 6 of 6

Thread: POST in a link

  1. #1

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    POST in a link

    Is there a way that i can do a POST (like in forms) through a URL?
    My usual boring signature: Something

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: POST in a link

    nope. that's what GET is used for.
    Like Archer? Check out some Sterling Archer quotes.

  3. #3

    Thread Starter
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: POST in a link

    didnt think so. how about submiting a form from a link?
    My usual boring signature: Something

  4. #4
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: POST in a link

    no. you can't do that. that's what GET is for.

    it might be possible to submit something automatically using JavaScript, but I somehow doubt it, because it would be a huge security risk if you think about it.
    Like Archer? Check out some Sterling Archer quotes.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: POST in a link

    Huh? It's no more of a security risk than submitting a form manually...

    You can either make a POST request with manual payload using XMLHttpRequest; or (easier) you can just call the submit() method of a form element on the page. I do this in one Javascript application to save form variables when switching pages; it works without a hitch.

    Anchor links point to another resource, not an action: that's why they are effected using GET requests.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: POST in a link

    You can also style a button|type="submit" to look like a link. I do this for logout links sometimes, because logout is a state-changing action and should thus be a POST request, yet style issues prohibit using an ugly button for that. And I have no graphical skills whatsoever.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width