1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What is the difference between get method and post method in Asp.Net ?

Discussion in 'C#' started by alendonald, Jul 8, 2013.

  1. #1
    Hi,
    I am little bit confuse between get method or post method, So tell me what is the difference between get or post method.
    SEMrush
     
    alendonald, Jul 8, 2013 IP
    SEMrush
  2. ByteCoder

    ByteCoder Active Member

    Messages:
    239
    Likes Received:
    2
    Best Answers:
    2
    Trophy Points:
    65
    #2
    GET and POST are both ways to send data from your client to your server page.

    GET = the data being sent to your server is coded into the URL.
    e.g site. com/page.aspx?key=value
    POST = the data being sent is hidden from the user's eye (he can inspect it but its not as visual as GET)
    e.g site. com/page.aspx

    anyhow, both of these are accessible the same way via ASP.NET, both are inside the Request struct.
    the recommendation is ofcourse to use POST if you dont have a reason to use GET, besides when dealing with query forms (search boxes etc) and such where the user then benefits from seeing his query, can change it via the browser's address bar etc etc.
     
    ByteCoder, Jul 9, 2013 IP
  3. designpack

    designpack Banned

    Messages:
    7
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    8
    #3
    Both are used to send data of the form to the another server page When you use get method variables of the form will be displayed in the addressbar of the browser and in post methid it will not be displayed
     
    designpack, Jul 14, 2013 IP
  4. qsearch

    qsearch Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #4
    i often use method post because it's safe
     
    qsearch, Jul 16, 2013 IP
  5. alendonald

    alendonald Greenhorn

    Messages:
    36
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    6
    #5
    Thanks for all to sharing your information with me.
     
    alendonald, Jul 19, 2013 IP
  6. Taruna P

    Taruna P Greenhorn

    Messages:
    13
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    13
    #6
    GET - Requests data from a specified resource
    POST - Submits data to be processed to a specified resource
     
    Taruna P, Sep 19, 2014 IP
  7. ethansamuel17

    ethansamuel17 Greenhorn

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    Thanks a lot "Bytecoder" for sharing this useful information about GET and POST method.
     
    ethansamuel17, Oct 6, 2014 IP
  8. Jagbir Saini

    Jagbir Saini Greenhorn

    Messages:
    10
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #8
    Jagbir Saini, Oct 14, 2014 IP
  9. pho3nix_

    pho3nix_ Active Member

    Messages:
    32
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    66
    Digital Goods:
    1
    #9
    GET get data from server, POST send data to server, DELETE its to send delete command to server to delete something and finally you have PUT.
     
    pho3nix_, Oct 24, 2014 IP
  10. anushka123

    anushka123 Greenhorn

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #10
    Hello friends,
    so many developer confused he/she said that get is used for get the data from server and post is used for post the data in server this is totally wrong(in starting i am also said this ).

    But Both Get and Post Method are form submission method.it is used for send the data from client side to server side.

    The Second Question where it is .

    The method is inside the form tag like below
    syntax is like below

    <form method="get||post">
    you use single method name get or post

    Third Question is ByDefault which method is used
    Ans is By default Get method are used
     
    anushka123, Oct 26, 2014 IP
  11. Core I-Solutions

    Core I-Solutions Greenhorn

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #11
    Two HTTP Request Methods: GET and POST
    Two commonly used methods for a request-response between a client and server are: GET and POST.
    • GET - Requests data from a specified resource
    • POST - Submits data to be processed to a specified resource
    The GET Method
    Note that query strings (name/value pairs) is sent in the URL of a GET request:

    /test/demo_form.asp?name1=value1&name2=value2
    Some other notes on GET requests:

    GET requests can be cached
    GET requests remain in the browser history
    GET requests can be bookmarked
    GET requests should never be used when dealing with sensitive data
    GET requests have length restrictions
    GET requests should be used only to retrieve data

    The POST Method
    Note that query strings (name/value pairs) is sent in the HTTP message body of a POST request:

    POST /test/demo_form.asp HTTP/1.1
    Host: w3schools.com
    name1=value1&name2=value2
    Some other notes on POST requests:

    POST requests are never cached
    POST requests do not remain in the browser history
    POST requests cannot be bookmarked
    POST requests have no restrictions on data length
     
    Core I-Solutions, May 2, 2015 IP
  12. zinist

    zinist Banned

    Messages:
    91
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    43
    #12
    Difference between GET and Post:
    GET
    Data will be arranged in HTTP header by appending to the URL as query string
    Data is in query string so user can view the data
    Less secured compared to POST method because data is in query string so it will be saved in browser history and web server logs
    As data is saved in URL so its saves only 2048 bytes data
    Can be bookmarked
    Hacking will be easy

    POST

    Data will be arranged in HTTP message body.
    Not visible to user
    Bit safer than GET method because data is not saved in history or web server logs
    Can be used for any amount of data
    Can’t bookmarked
    Hacking is difficult
     
    zinist, Jun 26, 2015 IP
  13. PoPSiCLe

    PoPSiCLe Illustrious Member

    Messages:
    4,630
    Likes Received:
    724
    Best Answers:
    152
    Trophy Points:
    470
    #13
    As for the "hacking is difficult" with post-data , that's wrong. It's just as easy as hacking get-data, you just need to change or create your own form which then posts to the form processor. Slightly harder, but not difficult. Which is why you ALWAYS need to secure the form handler server side.
     
    PoPSiCLe, Jun 26, 2015 IP
  14. jameswarner

    jameswarner Member

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #14
    Forms in HTML can use either method by specifying method=”POST” or method=”GET” in the <form>element.

    Key points about GET method

    • GET - Allow only ASCI character data type
    • It is not secure but GET methods fast & quickly working
    • Here in this method restrictions on form data length
    • Syntax:
    <form method=”GET” action=”abc.aspx”>
    • Data can be cached in get method
    Key points about POST method

    • POST – Allows also binary data
    • It is secure but slower than GET method
    • Syntax:
    <form method=”post” action=” abc.aspx”>
    • Here in this method no restriction on form data length
    • Data cannot cached in post method
     
    jameswarner, Feb 19, 2019 IP