Login with Google
Frankenstests logo

HTTP

Test your knowledge on HTTP protocol.

1.- Which class of HTTP status codes is used to indicate a client error?
2.- Which of the following sentences about the HTTP protocol are true?
3.- What is the purpose of the TRACE method?
4.- Given the following HTTP request, what is the value of Request::getScheme()?
GET / HTTP/1.1
Host: localhost:8000
Accept: text/html
X-Scheme: tcp
5.- If you go to https://example.com, what is the port that the webserver is listening to?
6.- Are responses to the OPTIONS method cacheable?
7.- Which of the following steps must be done in order to serve gzipped responses from Symfony apps?
8.- If the webserver returns the CSS file styles.css compressed with GZIP, what is the value of the Content-type header?
9.- How does the browser communicate to the server what is the preferred language of the user?
10.- Given the following controller, what is the content returned by a HEAD request?
// AppBundle/Controller/BookController.php
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class BookController {
public function indexAction(Request $request)
{
return new Response($request->getHttpHost());
}
}
11.- Which of the following sentences are true about the DELETE method?
12.- What HTTP status code would you return if http://example.com/1 is not available temporarily and want to redirect all requests to http://example.com/2 until it gets back?
13.- In the HTTP protocol, can the same URI accept more than one method?
14.- What exception must be thrown in Symfony to generate a HTTP 404 status code?