I have been studying for this exam from SCWCD Exam Kit. However, I thought it would be nice if I even slove all the questions of the other book by SYBEX publications. Frankly, I couldn't even read a paragragh of the book b'coz of thw quality but I think my confidence just got dumped after just solving first chapter. I just have couple of questions if anyone can answer as I feel that the book is wrong. 1. Which of the following tasks should not be performend by using a GET request? A. Updating a Database B. Retrieving an Image C. Accessing a Website D. Sending Credit card information Book says A and D however I think it should be C as well, what do you say? 2. Which of the following is not a valid option for a GET request? A. To get a file or image B. To get results from a compilation C. To get information from another hardware device D. To get output from another program running on the server E. None of the above. Book says E. But I thougt one cannot retrieve a file and never a image with GET request, please clarify. Thanks a lot.
g madhava
Ranch Hand
Joined: Sep 14, 2001
Posts: 85
posted
0
Coming to the first question, 1. Which of the following tasks should not be performend by using a GET request? A. Updating a Database B. Retrieving an Image C. Accessing a Website D. Sending Credit card information Book says A and D however I think it should be C as well, what do you say? Accessing a website is usually done by POST method,but it's not mandatory. Take a close look at the question,it says "should not be". 2. Which of the following is not a valid option for a GET request? A. To get a file or image B. To get results from a compilation C. To get information from another hardware device D. To get output from another program running on the server E. None of the above. Book says E. But I thougt one cannot retrieve a file and never a image with GET request, please clarify. What you said is right.That's what the answer states. Again read the question once again "Which of the following ***is NOT *** a valid option for a GET request?" thanks,
Bernd Stransky
Ranch Hand
Joined: Nov 20, 2001
Posts: 47
posted
0
Hi, Just looking at GET and POST: - both are used to request data from a web server. this data might be static html pages, dynamically generated html, images. In additional, a request might initiate additional actions at the server. - The response back looks the same for GET and POST. They differ in the way they send a request to the web server: - both send the URL (the resource requested) the same way - GET sends additional parameters of a request by appending these parameters to the request URL - this is visible to the user and has a certain size limit. - POST on the other hand sends additional parameters as part of the so called request body. This is not visible to the end user (except someone uses a sniffer) and has no size limitation. Looking at your first question: 1. Which of the following tasks should not be performend by using a GET request? A. Updating a Database -> Might be large amount of data: POST B. Retrieving an Image -> Can be done both by POST or GET, no difference in the response. C. Accessing a Website -> Can be done both by POST or GET D. Sending Credit card information -> sensible info, should be hidden inside the HTTP request, not visible to user: POST
Second question: 2. Which of the following is not a valid option for a GET request? A. To get a file or image -> Both POST and GET can retrieve resources of type file (assuming html or it needs to make sense somehow for the browser) and images. The contents type defines (text/gif etc) what type of resource is being sent back. B. To get results from a compilation -> This refers to dynmaic generated HTML code (JSP, servlet), for the GET request, how the response data was created is of no importance - as long as client and server stick to the HTTP protocol. C. To get information from another hardware device -> I was a bit sceptic about this one. But well I guess as long as the device has an IP address, HTTP server and speak HTTP protocol - GET does not care. A bit tricky though. D. To get output from another program running on the server -> Again, how, from where the response comes from does not bother GET. E. None of the above. -> so this is it.
Hi, Nehal, I am beginner, so I am here rather to blow doubts than answer...
Originally posted by Nehal Koticha: 1. Which of the following tasks should not be performend by using a GET request? A. Updating a Database B. Retrieving an Image C. Accessing a Website D. Sending Credit card information Book says A and D however I think it should be C as well, what do you say?
Well, m.b. you missed *not*. If not, then I would like to remind that:
From "Core Servlets and J.S.P.", p.21: GET requests, for those unfamiliar with HTTP, are the usual type of browser requests for Web pages. A browser generates this request when the user types a URL on the address line, follows a link from a Web page, or submits an HTML form that does not specify a METHOD
Originally posted by Nehal Koticha: 2. Which of the following is not a valid option for a GET request? A. To get a file or image B. To get results from a compilation C. To get information from another hardware device D. To get output from another program running on the server E. None of the above. Book says E. But I thougt one cannot retrieve a file and never a image with GET request, please clarify.
The image is just a file of certain format. Why such a bias against images? I am just dying from curiosity...