Friday, January 31, 2014

Assignment #1 (30 Jan)


12. A request that retrieves the document at /usr/users/doc/doc1  . With at least two general headers,  two request headers, and one entity header.


GET  /usr/users/doc/doc1  HTTP/1.1
Date: Fri, Jan 31 01 2014 19:45:00 GMT+5:30

Accept: */*
Accept-charset: UTF-8

Content-encoding: MIME-version 1.0





13. Response to above request if there’s an error in request syntax
HTTP/1.1 400 Bad Request
Date: Fri, Jan 31 01 2014 19:45:05 GMT+5:30

Content-length: 30

Content-type: application/json
{
  "error" : "invalid_syntax"
}




14. Response in case that has permanently moved to /usr/deads/doc1
HTTP/1.1 301 Moved permanently
Date: Fri, Jan 31 01 2014 19:45:05 GMT+5:30

Content-length: 42

Content-type: application/json
{
  "error" : "moved to /usr/deads/doc1"
}




15. Storing a file at /bin/letter. Client identifies file types it can accept.
PUT  /bin/letter  HTTP/1.1
Date: Fri, Jan 31 01 2014 19:45:00 GMT+5:30

Accept: text/html
Accept-charset: UTF-8

Content-type: text/html
Content-encoding: MIME-version 1.0
(File body)



17. Request that asks for information about document stored at /bin/users/file. Use at least two general and one request header.
HEAD  /bin/users/file HTTP/1.1
Date: Fri, Jan 31 01 2014 19:46:00 GMT+5:30

Accept: text/html




18. Show the request to delete file at location /bin/file1
DELETE  /bin/file1  HTTP/1.1
Date: Fri, Jan 31 01 2014 19:45:00 GMT+5:30

Authorization: Bearer y.291039347393456564




19. Show the response to Exercise 15. The response shows age of the document as well as date and time when contents may change
HTTP/1.1 200 OK
Content-location: http:// : www.titagartala.nic.in/bin/letter

Last-modified: Fri, Jan 31 01 2014 19:45:00 GMT+5:30
Expires: Fri, 31 Jan 2014 15:07:51 GMT

Content-type: text/html



 --------------------------------------------------------------------
Post added on 9th February
----------------------------------------


20. Show the request to copy the file at location /bin/usr/bin/file1 to /bin/file1
GET  /bin/usr/bin/file1  HTTP/1.1
Date: Fri, Jan 31 01 2014 19:45:00 GMT+5:30

Accept: text/html
Accept-charset: UTF-8



PUT  /bin/file1  HTTP/1.1
Date: Fri, Jan 31 01 2014 19:45:00 GMT+5:30

Content-type: text/html
Content-encoding: MIME-version 1.0

(File body from above request’s response)



21. Show the response to exercise 12 if the client is unauthorized to access the document.
HTTP/1.1 401 Unauthorized
Date: Fri, Jan 31 01 2014 19:45:05 GMT+5:30

Content-type: application/json
{
  "error" : "client_unauthorized"
}


22. Show the response to Exercise 18.
HTTP/1.1 202  Accepted
Content-location: http:// : www.titagartala.nic.in/bin/file1

Content-type: text/html
Content marked for deletion.


23. Show the response to Exercise 12 for a successful request.
HTTP/1.1 200 OK

Last-modified: Fri, Jan 31 01 2014 19:45:00 GMT+5:30
Expires: Fri, 31 Jan 2014 15:07:51 GMT

Content-type: text/html
(File body)


24. Show the request to retrieve the file at /bin/etc/file1. The client should identify itself.
GET  /bin/etc/file1  HTTP/1.1
Date: Fri, Jan 31 01 2014 19:45:00 GMT+5:30

Authorization: Bearer y.291039347393456564
User-Agent: “TIT-admin_PC”
From: webmaster@titagartala.nic.in

Accept: text/html
Accept-charset: UTF-8




26. Show the response to Exercise 24.
HTTP/1.1 200 OK
Content-location: http://www.titagartala.nic.in/bin/etc/file1

Last-modified: Fri, Jan 31 01 2014 19:45:00 GMT+5:30
Expires: Fri, 31 Jan 2014 15:07:51 GMT

Content-type: text/html
(File body)


27. Show the response to Exercise 20.
HTTP/1.1 201  Created
Content-location: http:// : www.titagartala.nic.in/bin/file1
Date: Fri, Jan 31 01 2014 19:45:00 GMT+5:30

Content-type: text/html
Content-encoding: MIME-version 1.0




28. Show the request to retrieve the file at /bin/etc/file1. The client needs it only if modified after January 23 1993.
GET  /bin/etc/file1  HTTP/1.1
If-Modified-Since: Jan 23 1999

Accept: text/html
Accept-charset: UTF-8



29. Show the response to Exercise 17 for a successful request.
HTTP/1.1 200 OK
Content-location: http:// : www.titagartala.nic.in/bin/users/file

Last-modified: Fri, Jan 31 01 2014 19:45:00 GMT+5:30
Expires: Fri, 31 Jan 2014 15:07:51 GMT

Content-type: text/html



30. Show the response to exercise 28.
HTTP/1.1 304 Not modified
Content-location: http:// : www.titagartala.nic.in/bin/etc/file1

Last-modified: Fri, Jan 31 01 1992 19:45:00 GMT+5:30

Content-type: text/html



No comments:

Post a Comment