GET module¶
-
class
methods.GET.
GET
¶ Bases:
object
-
static
fill_image_params
(response: message.Response.Response, image_params: dict, uri: str) → None¶ Add headers in response, based on image params
- Parameters
response – Response
image_params – Dictionary with image params
uri – String of URL
-
static
getParamsFromURL
(url)¶ Performs a parse of the parameters present in the URL
- Parameters
URI – String of the url
- Returns
A dictionary with all parameters contained in the URL
-
imagesTable
= {'/deusgrego.jpeg': {'filePath': './assets/static/deusgrego.jpeg', 'type': 'image/jpeg'}, '/error.gif': {'filePath': './assets/static/error.gif', 'type': 'image/gif'}, '/logo.ico': {'filePath': './assets/static/logo.ico', 'type': 'image/x-icon'}, '/logo.png': {'filePath': './assets/static/logo.png', 'type': 'image/png'}, '/menu1.gif': {'filePath': './assets/static/menu1.gif', 'type': 'image/gif'}, '/menu2.gif': {'filePath': './assets/static/menu2.gif', 'type': 'image/gif'}, '/menu3.gif': {'filePath': './assets/static/menu3.gif', 'type': 'image/gif'}, '/newfriend.jpeg': {'filePath': './assets/static/newfriend.jpeg', 'type': 'image/jpeg'}, '/slide1.jpg': {'filePath': './assets/static/slide1.jpg', 'type': 'image/jpeg'}, '/slide2.png': {'filePath': './assets/static/slide2.png', 'type': 'image/png'}, '/slide3.png': {'filePath': './assets/static/slide3.png', 'type': 'image/png'}}¶
-
static
response
(request: message.Request.Request) → str¶ Performs a return operation when there is a request of type GET, returning a response with the headers and the correct body. Search within the mapped URLs, the received URL, returning the requested resource.
- Parameters
request – Request object, containing the body and headers of that request
- Returns
The answer to this request
-
urlTable
= {'/': {'filePath': './assets/public/index.html', 'type': 'text/html'}, '/bootstrap.min.css': {'filePath': './assets/bootstrap.min.css', 'type': 'text/css'}, '/bootstrap.min.js': {'filePath': './assets/bootstrap.min.js', 'type': 'text/css'}, '/dashboard.css': {'filePath': './assets/dashboard.css', 'type': 'text/css'}, '/database': {'filePath': './databaseUser/database.json', 'type': 'application/json'}, '/edit': {'filePath': './assets/public/put.html', 'type': 'text/html'}, '/error': {'filePath': './assets/public/error.html', 'type': 'text/html'}, '/list': {'filePath': './assets/public/list.html', 'type': 'text/html'}, '/popper.min.js': {'filePath': './assets/popper.min.js', 'type': 'text/css'}, '/post': {'filePath': './assets/public/post.html', 'type': 'text/html'}}¶
-
static