This assignment is writing a python program on Linux for aparser for HTTP GET to read in lines of characters from standardinput (i.e., the keyboard) and determine which lines, if any, arelegal HTTP GET requests. Guidelines are attached below. For furtherclarification, read the “The Assignment” section.
The following is the test code you will use to test against yourown written code:
MakeInput1.py
import syssys.stdout.write(‘GET /index.html HTTP/1.0’)sys.stdout.write(‘GET /index2.html HTTP/1.0’)sys.stdout.write(‘GET /cat.png HTTP/1.0’)
MakeOutput1.py
import syssys.stdout.write(‘GET /index.html HTTP/1.0’)sys.stdout.write(‘Method = GET’)sys.stdout.write(‘Request-URL = /index.html’)sys.stdout.write(‘HTTP-Version = HTTP/1.0’)sys.stdout.write(‘<!DOCTYPE html>’)sys.stdout.write(‘<html>’)sys.stdout.write(‘<body>’)sys.stdout.write(‘<h1>COMP431</h1>’)sys.stdout.write(‘</body>’)sys.stdout.write(‘</html>’)sys.stdout.write(‘GET /index2.html HTTP/1.0’)sys.stdout.write(‘Method = GET’)sys.stdout.write(‘Request-URL = /index2.html’)sys.stdout.write(‘HTTP-Version = HTTP/1.0’)sys.stdout.write(‘404 Not Found: /index2.html’)sys.stdout.write(‘GET /cat.png HTTP/1.0’)sys.stdout.write(‘Method = GET’)sys.stdout.write(‘Request-URL = /cat.png’)sys.stdout.write(‘HTTP-Version = HTTP/1.0’)sys.stdout.write(‘501 Not Implemented: /cat.png’)
PayPal Gateway not configured
PayPal Gateway not configured