Overview of HTTP Protocols and Response Codes

Slide Note
Embed
Share

Exploring the basics of HTTP protocols and response codes, including details on HTTP GET and POST methods, along with examples of request and response structures. An in-depth look at various status codes and their meanings, such as informational, success, redirection, client errors, and server errors.


Uploaded on Sep 28, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. 1 ASP.NET Web applications ICD0015 TalTech IT College, Andres K ver, 2018-2019, Spring semester Web: http://enos.Itcollege.ee/~akaver/ASP.NETCore Skype: akaver Email: akaver@itcollege.ee

  2. HTTP - GET 2 HTTP is purely text based protocol, basically you are just sending bunch of key-value pairs from browser to server GET https://localhost:44363/People/Create HTTP/1.1 Host: localhost:44363 Connection: keep-alive Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Referer: https://localhost:44363/People Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9,et;q=0.8 Cookie: _ga=GA1.1.1433392067.1524809543;

  3. HTTP GET - response 3 HTTP/1.1 200 OK Cache-Control: no-cache, no-store Pragma: no-cache Content-Type: text/html; charset=utf-8 Server: Microsoft-IIS/10.0 X-SourceFiles: =?UTF- 8?B?QzpcVXNlcnNcYWthdmVyXHNvdXJjZVxyZXBvc1xIVFRQVGVzdFxXZWJBcHBcUGVvcGxlXENy ZWF0ZQ==?= X-Powered-By: ASP.NET Date: Sat, 26 Jan 2019 12:24:13 GMT Content-Length: 3367 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Create - WebApp</title>

  4. HTTP - POST 4 POST https://localhost:44363/People/Create HTTP/1.1 Host: localhost:44363 Connection: keep-alive Content-Length: 194 Cache-Control: max-age=0 Origin: https://localhost:44363 Upgrade-Insecure-Requests: 1 Content-Type: application/x-www-form-urlencoded User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 Referer: https://localhost:44363/People/Create Accept-Encoding: gzip, deflate, br Accept-Language: en-US,en;q=0.9,et;q=0.8 Cookie: _ga=GA1.1.1433392067.1524809543; Name=Andres&__RequestVerificationToken=CfDJ8JXfYWVYzpxPgG_38dOFAzHQGkoaDtNMXtzBr3vNUF UDOYe7XT_ueh6IMyEfRXYWTTOvd2Bjm8gxjOwN8jRBGngeIIKZmnJB- xD4Wvd1enqy0M5GrgAWVgAOg0vZPgHNzvIYDBTmwJqi3L2WYM-5mm4

  5. HTTP- POST - response 5 HTTP/1.1 302 Found Location: /People Server: Microsoft-IIS/10.0 X-SourceFiles: =?UTF- 8?B?QzpcVXNlcnNcYWthdmVyXHNvdXJjZVxyZXBvc1xIVFRQV GVzdFxXZWJBcHBcUGVvcGxlXENyZWF0ZQ==?= X-Powered-By: ASP.NET Date: Sat, 26 Jan 2019 12:17:16 GMT Content-Length: 0

  6. Distributed HTTP response codes 6 1xx Informational response 100 continue, 101 switching protocols 2xx Success 200 OK, 201 Created, 202 Accepted, 204 No Content 3xx Redirection 300 Multiple choices, 301 Moved Permanently, 302 Found, 303 See other, 304 Not Modified 4xx Client errors 400 Bad Request, 401 Unauthorized, 403 Forbidden, 404 Not Found, 409 Conflict 5xx Server errors 500 Internal Server Error, 501 Not implemented, 503 Service Unavailable

  7. MVC (MVP, MVVM, ...) 7 MVC pattern is from SmallTalk team, first academic paper is from year 1979 By the original definition MODEL business info and logic VIEW visual (partial) representation of model CONTROLLER middle part in between user and system Modern web uses the same pattern html as model, css as view and browser as controller

  8. MVC 8 CONTROLLER User Action Update Update Notification MODEL VIEW

  9. MVC Why? 9 Separation of Concerns business logic (model) and user interface (view) should be separated from each other. BL/Model represent our understanding of real world, UI is just for presentation and manipulation Business logic should be totally independent Business logic should be able to support several different UI-s Controller intermediates between BL and UI Good teamwork, testable code

  10. ASP.NET MVC, WebForms 10 MS has several Web technologies .NET Core and ASP.NET Core Multiplatform (Win, macOS, Linux), modular, extremely fast, modern, open source ASP.NET MVC is predecessor to ASP.NET Core, tightly coupled to IIS and Windows .NET framework. WebForms is even older technology (Sharepoint) Similar to desktop development Unclean and cluttered html, state is saved into html Lots of readymade components Every page has its own code behind

  11. Demo Contact app 11 Create a simple web application, that manages basic contact database and allows searches from it Required features Add, change and remove Persons, Contacts and Contact Types Add n comments to Persons (creation Date and time) Statistics and detail views about Person and Contact Type Search functionality in persons (First name, Last Name, Company) contacts (contact type and value) Removal of persons and contacts logical and hard delete UOW, Repos, i18n are not required. ViewModels are required.

  12. 12

Related