A servlet needs to handle a file upload from a web form. Which HTTP method and content type should be used?
- DELETE with text/plain
- GET with application/x-www-form-urlencoded
- POST with multipart/form-data
- PUT with application/json
For handling file uploads, the appropriate combination is to use the POST method along with the multipart/form-data content type.
Loading...
Related Quiz
- Which listener interface allows you to gather statistics about session usage in your web application?
- The _________ interface in Java EE allows the server to react to WebSocket lifecycle events.
- What must be done to ensure the safe and correct download of files with different character encodings?
- A servlet handling massive data queries is experiencing performance issues. What optimization technique should be prioritized?
- Load balancing is critical in a _________ architecture to distribute traffic evenly across servers.