这里就直接截图了,如下(很简单的操作):

1:Get几种请求

2:Post

3:Put

4:Delete

 最后,虽然简单,代码还是给放一下(这里只是抛砖引玉的作用,自己可以根据自身的业务需要来做进一步的优化和封装):

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using WebApplication.Models; // For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
namespace WebApplication.Controllers
{
[Route("api/[controller]")]
public class ValuesController : Controller
{
// GET: api/<controller>
[HttpGet]
//public IEnumerable<string> Get()
//{
// return new string[] { "value1", "value2" };
//} //// GET api/<controller>/5 //[HttpGet("{id}/{name}")]
//public string Getother(int id, string name)
//{
// return "id=" + id + ", name=" + name;
//} //[HttpGet("{id}")]
//public string GetByid(int id)
//{
// return "value" + id;
//} public string Get(Mystu student)
{
return student.name;
} // POST api/<controller>
[HttpPost]
public void Post(string type, [FromBody]Mystu student)
{
string temp = type + $"id={student.id},name={student.name}";
} // PUT api/<controller>/5
[HttpPut()]
public void Put(int id, [FromBody]Mystu student)
{
string pstr = $"id={id},sid={student.id},name={student.name}";
} // DELETE api/<controller>/5
[HttpDelete("{id}")]
public void Delete(int id)
{
string temp = $"长官{id}说:我们要把坏分子给清除掉";
}
}
public class Mystu
{
public int id { get; set; }
public string name { get; set; }
}
}

 5:新增文件上传

6:PostMan请求参数为枚举类型

  枚举之外 取不到就为假,假就为0了,或者是默认值

枚举的类:

 

最新文章

  1. 9. 了解 Cocoa-百度百科
  2. `这个符号在mysql中的作用
  3. 调试SQLSERVER (二)使用Windbg调试SQLSERVER的环境设置
  4. FIR.im Weekly - 上周微博热转资源精选
  5. ListView嵌套出现的问题
  6. iOS开发中(null)与&lt;null&gt;的判断
  7. 用IKVMC将jar转成dll供c#调用
  8. js除法余数
  9. mysql innodb 数据打捞(四)innodb 簇不连续页扫描提取(试验)
  10. ThinkPadTablet如何恢复出厂状态
  11. 利用maven的resources、filter和profile实现不同环境使用不同配置文件
  12. Windows操作系统分类
  13. CentOS 6 升级 curl
  14. thinkphp生成的验证码不显示问题解决
  15. 酷!美国国家安全局(NSA)开源了逆向工程工具 Ghidra
  16. 程序设计实习MOOC / 程序设计与算法(三)第一周测验
  17. Beego 和 Bee 的开发实例
  18. predict.glm -&gt; which class does it predict?
  19. 密码加密MD5,Bash64
  20. C++ 类模板四(typename关键字)

热门文章

  1. DataGridView中的rows.Count比实际行数多1的原因以及解决办法
  2. JavaScript操作数据库JS操作Access数据库
  3. c# 打印的问题总结
  4. DS12C887实时时钟
  5. v-bind是是否需要绑定某一个类名
  6. C# WF 第12节 Timer控件
  7. Pwn-level3
  8. day4_7.2
  9. lua 11 闭包,函数的使用
  10. skkyk:题解 洛谷P2420 【让我们异或吧】lca+xor前缀和