0

I came across a ocwcd question as follows:

<form action="sendOrder.jsp"> 
  <input type="text" name="creditCard">
  <input type="text" name="expirationDate"> 
  <input type="submit"/> 
</form> 

considering the above piece of code question is : when creating a web form with this HTML which HTTP method is used when sending this request from the browser?

Options were given as below:

A. GET
B. PUT
C. POST D. SEND
E. FORM

In my view ans will be C.POST.but answer is given as A.GET

Can anyone provide any explanation to this???or is it a typo error in solution sheet?

Sumit Ghosh
  • 484
  • 4
  • 13
  • 36
  • I think it is better to add "method" attribute into form tag to set http request method. – qichunren Dec 05 '17 at 04:47
  • 1
    GET is the default form submission method. Take a look at https://stackoverflow.com/q/2314401/1039555. – Kartik Dec 05 '17 at 04:50
  • qichunren,we all know that,it is an exam question.And question is that whether GET or POST which one will be prefereble? – Sumit Ghosh Dec 05 '17 at 04:51

1 Answers1

1

GET is the default form submission method. Take a look at stackoverflow.com/q/2314401/1039555.

Kartik
  • 7,677
  • 4
  • 28
  • 50