• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Problem in Mock exam

 
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a problem in solving a question 2 of Java beat mock simulator.

------------------------------------------------------------------------
2. You need to send large amount of binary data from the browser to a servlet to be processed. (Say, you want to attach a file while sending email through a web based system). What HTTP method would you use?
Select 1 correct option.
A.GET
B.POST
C.HEAD
D.HIDDEN
E.PUT
-------------------------------------------------------------------------
Correct answer given is B. whereas I think answer is E
Reason:- I could get this statement from Mikalai's note that "The PUT
operation allows a client to place a file on the server and is similar to sending a file by FTP." and as data in this case is "large amount of binary data". I think E is better option than B.

Please reply whether I am right/wrong?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The PUT method is not supported by browsers (or HTML forms), so that would not work.

It is possible to create PUT requests using the JavaScript XMLHttpRequest object, but JavaScript has no access to the client file system.
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you are wrong. PUT overwrites target url with the content you send.
The question clearly specifies that the servlet needs to process the content. So the content is POSTed.
reply
    Bookmark Topic Watch Topic
  • New Topic