随笔分类 -  WebApi

摘要:多个参数无需自定义类,get 就1种写法,post共2种写法 html <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title></title> </head> <body> <div> <form id="form_add"> < 阅读全文
posted @ 2021-12-18 16:23 WebApi 阅读(729) 评论(0) 推荐(0) 编辑
摘要:JSON Web Token(缩写 JWT)是目前最流行的跨域认证解决方案,本文介绍它的用法。 jwt原理请看这里 1、nuget中安装jwt 2、新建3个实体 using System; using System.Collections.Generic; using System.Linq; us 阅读全文
posted @ 2021-10-27 17:35 WebApi 阅读(1742) 评论(0) 推荐(0) 编辑
摘要:一、MVC提交 视图 @using (Html.BeginForm()) { @Html.AntiForgeryToken() <p> <strong><em>*</em>姓名:</strong><input type="text" id="name" name="name" /> </p> <p> 阅读全文
posted @ 2021-10-09 09:48 WebApi 阅读(288) 评论(0) 推荐(0) 编辑
摘要:跨越问题主要发生在客户端ajax请求时,为了安全设置,默认webapi是不允许ajax跨越请求的,不过有方法设置让支持跨越,我说说最常见的两种方法 一、jquery jsonp 缺点:JSONP也有局限性,只能针对于Get请求不能用于POST请求 1、新建过滤器 Filters/JsonCallba 阅读全文
posted @ 2019-03-16 15:40 WebApi 阅读(1322) 评论(0) 推荐(0) 编辑
摘要:webapi html webapi下载文件教程:https://www.cnblogs.com/webapi/p/10540916.html 阅读全文
posted @ 2019-03-16 13:53 WebApi 阅读(4745) 评论(0) 推荐(0) 编辑
摘要:WebApi是微软在VS2012 MVC4版本中绑定发行的,webapi2.0同mvc5发行的 webapi一共有以下接口返回值 1、void无返回值2、IHttpActionResult Json(T content) Ok()、 Ok(T content) NotFound() 其他 自定义IH 阅读全文
posted @ 2019-03-16 10:19 WebApi 阅读(10348) 评论(0) 推荐(0) 编辑
摘要:swagger简介 别名:丝袜哥 功能:用于生产api文档 swagger安装 Nuget搜索swagger,然后安装Swashbuckle swagger使用 生成api的xml文档 webapi项目右键——属性——生产——输出 汉化Swagger 新建一个js,目录/Scripts/Swagge 阅读全文
posted @ 2019-03-15 16:24 WebApi 阅读(8643) 评论(2) 推荐(2) 编辑
摘要:webapi简介 在asp.net中,创建一个HTTP服务,有很多方案,以前用ashx,一般处理程序(HttpHandler),现在可以用webapi 微软的web api是在vs2012上的mvc4项目绑定发行的,它提出的web api是完全基于RESTful标准的,完全不同于之前的(同是SOAP 阅读全文
posted @ 2019-02-27 10:21 WebApi 阅读(11729) 评论(0) 推荐(3) 编辑

CopyRight © 博客园 WebAPI
点击右上角即可分享
微信分享提示