Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Another tough question

 
green hand
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which two are true about the HTTP POST method? (Choose two)
A. POST requests are faster.
B. It supports multipart MIME requests.
C. Request data is sent in a separate content block.
D. Parameters are accessible using the getQueryString method of the
HttpServletRequest interface.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by green hand:
Which two are true about the HTTP POST method? (Choose two)
A. POST requests are faster.
B. It supports multipart MIME requests.
C. Request data is sent in a separate content block.
D. Parameters are accessible using the getQueryString method of the
HttpServletRequest interface.

I think B, C.
I dont know whether a POST request is faster than a GET request. In the aspect of the limitation, since GET can only send 255 words data, while POST can send, in theory, unlimited data, POST should be slower in this sense.
D is incorrect because only GET requests use query string.
Nick
 
green hand
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not clear about C, can you elaborate more, thanks.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since POST request data can be sent in multipart, for example, the form data, and the upload file information, and thus, they are sent in 2 different content blocks to the server.
Nick
 
Sudhir Meduri
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I forgot the exact terminology
but what happens is the POST data(stream data) sits in a sperate block
in the response header.
I think thats what the 'content' in the question meant
Thanks
Sudhir
 
Jeff Walker
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by green hand:
Which two are true about the HTTP POST method? (Choose two)
A. POST requests are faster.
B. It supports multipart MIME requests.
C. Request data is sent in a separate content block.
D. Parameters are accessible using the getQueryString method of the
HttpServletRequest interface.

Well, I'll work backwards; A. is wrong since its not actually compared to any other request type. E.g. POST is slower on average than a GET (which is what the other posters are trying to say) but I think a HEAD request will beat them all.
D. is wrong because you can't get the parameters out of the query string (I don't think they are there, they are in a separate block, for POST requests).
So by default, B. and C. must be correct answers.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic