首页 > 其他分享 >Web

Web

时间:2023-10-16 20:13:35浏览次数:27  
标签:Web HTTP web request returns data response

A web application is a computer program that responds to an HTTP request by a client and sends back HTML to the client in an HTTP response. In other words, a web application is a server — a web server, to be exact. The client is usually a web browser, and they communicate over HTTP. 

A web service , on the other hand, is a computer program that responds to an HTTP request by a client that is not a browser used by a human user but another computer program. A web service is a server as well, but it usually returns JSON, and it increasingly also returns binary formats. 

 

Parts of a Web Application
A web application generally consists of three parts:
A multiplexer
• A router that matches the request URI to a handler function
One or more handlers
• Functions that handle the requests and return the responses
A template engine
• An engine that combines one or more templates with data and renders the response

The multiplexer is quite straightforward. It simply matches the request URI to a handler according to a URL route. For example, you want to match the URL route /home to a homeHandler function.
The handler function is where the real work is done. It takes in a request, does some processing with the data from the request, and returns a response. 
The template engine is used to render the body of the response. It combines one or more templates with data and returns the response body. While this is commonly HTML, it can be any format, including JSON, XML, plain text, or even binary data, such as images and PDFs. 

标签:Web,HTTP,web,request,returns,data,response
From: https://www.cnblogs.com/zhangzhihui/p/17768233.html

相关文章

  • Stable-diffusion WebUI API调用方法
    写这篇文章的主要原因是工作中需要写一个用训练好的模型批量生图的脚本,开始是想用python直接加载模型,但后来发现webui的界面中有不少好用的插件和参数,所以最终改成调用WebUI接口的方式来批量生图。Stable-diffusion的webui界面使用比较方便,但是它的api文档比较简陋,很多功能需要......
  • java web
    0.了解maven1.了解http协议2.了解tmcat的作用3.了解请求响应4.了解分层解耦5.了解servlet原理Maven为java世界引入了一个新的依赖管理系统jar包管理jar包升级时修改配置文件即可......
  • WebAPI和MVC的区别
    1.MVC主要用于建站,WebAPI主要用于构建http服务MVC是前端和后端不分离,WebApi是后端写的http服务提供前端,是前后端分离的写法;2.MVC可以返回JsonResult,前端可以直接使用;WebAPI要返回JSON数据,必须JSON.parse()转化为(Maticsoft.Json.dll)3. MVC直接继承system.mvc.cont......
  • [SWPU2019]Web1
    原理空格过滤or过滤的替代词无列名注入二次注入解题过程以后再写过程参考文章:https://blog.csdn.net/qq_56313338/article/details/132526998......
  • webpack模块打包工具
    yarn包管理器快速、可靠、安全的依赖管理工具。和npm类似,都是包管理工具,可以用于下载包,就是比npm快中文官网地址:https://yarn.bootcss.com/下载yarn下载地址:https://yarn.bootcss.com/docs/install/#windows-stablewindows-软件包(在笔记文件夹里)mac-......
  • [CISCN2019 华东南赛区]Web11
    原理smartySSTI模板注入解题过程首先进入靶场,看到currentIP,猜测是自己的ip,怎么获取的,大概率是请求包的X-Forwarded-For字段之后又看到了文件底部的smarty,是php的一种模板,思路清晰了,估计是在X-forwarded-for进行ssti注入二话不说抓包没看到X-Forwarded-For字段咋办,自己写......
  • WebGIS:明小图
         ......
  • 自邮之翼Java Web开发入门学习之旅 阶段一
    这个阶段的任务是“完成开发环境的安装和配置,并基于JSP实现一个“HellotheWorld”页面。主要使用的开发环境为:IntellijJava,进行开发前需要完成的环境配置如下:·配置java环境(JDK17)·配置maven环境(apache-maven-3.9.4)·配置Tomcat环境(apache-tomcat-10.1.13)以上均需要......
  • uniGUI使用WebSocket
    现在的uniGUI最新版本,经过几个版本的迭代,已经完美支持WebSocket。用起来,也非常简单,默认情况下,已经打开WebSocket。打开demos中的第一个例子: C:\ProgramFiles(x86)\FMSoft\Framework\uniGUI\Demos\Desktop\WebSocket-Basic在Main单元,可以看到:1.如何广播一个消息:BroadcastM......
  • Secure Code Warrior Introduction to OWASP Top 10 Awareness (with latest updates
    MissingFunctionAccessControlAccesstothesefunctionalitiesshouldberestrictedtoauthenticatedusers.However,thecurrentmechanismonlycheckswhetherauserexists.Anyuser,authenticatedornot,willbeabletoaccessrestrictedinformation.U......