当前位置: 首页 > news >正文

传奇网站劫持怎么做正版google下载

传奇网站劫持怎么做,正版google下载,延安网站建设,网站建设进度及实施过程nest.js控制器: 控制器负责处理传入请求并向客户端返回响应。 为了创建基本控制器,我们使用类和装饰器。装饰器将类与所需的元数据相关联,并使 Nest 能够创建路由映射(将请求绑定到相应的控制器)。 1.获取get请求传参…

nest.js控制器: 控制器负责处理传入请求并向客户端返回响应。
为了创建基本控制器,我们使用类和装饰器。装饰器将类与所需的元数据相关联,并使 Nest 能够创建路由映射(将请求绑定到相应的控制器)。
在这里插入图片描述

1.获取get请求传参,用@Request装饰器或者@Query()装饰器

import {Controller,Get,Request,
} from '@nestjs/common';import { WeiService } from './wei.service';@Controller({path: 'wei',version: '1', //版本控制
})
export class WeiController {constructor(private readonly weiService: WeiService) { }// @Request装饰器@Get()findAll(@Request() req) {console.log('@', req.query)return {code: 200,message: '请求成功W'}}
}
import {Controller,Get,Query,
} from '@nestjs/common';import { WeiService } from './wei.service';@Controller({path: 'wei',version: '1', //版本控制
})
export class WeiController {constructor(private readonly weiService: WeiService) { }// @Query()装饰器@Get()findAll(@Query() query) {console.log('@@', query)return {code: 200,message: '请求Q成功'}}
}

2.post请求获取参数,用@Request装饰器或者@Body 装饰器

import {Controller,Get,Query,
} from '@nestjs/common';import { WeiService } from './wei.service';@Controller({path: 'wei',version: '1',
})
export class WeiController {constructor(private readonly weiService: WeiService) { }//用@Request装饰器@Post()create(@Request() req) {console.log(req.body)return {code: 200,message: '请求成功!'}}
}
import {Controller,Get,Query,
} from '@nestjs/common';import { WeiService } from './wei.service';@Controller({path: 'wei',version: '1',
})
export class WeiController {constructor(private readonly weiService: WeiService) { }//用@Body装饰器@Post()create(@Body() body) {console.log(body)return {code: 200,message: '请求成功!'}}
}

读取请求体中得key值

import {Body,Controller,
} from '@nestjs/common';import { WeiService } from './wei.service';@Controller({path: 'wei',version: '1',
})
export class WeiController {constructor(private readonly weiService: WeiService) { }// 读取key@Post()create(@Body("title") body) {console.log(body)return {code: 200,message: '请求成功'}}
}

动态传参使用 Request装饰器 或者 Param 装饰器

import {Controller,Request,
} from '@nestjs/common';import { WeiService } from './wei.service';@Controller({path: 'wei',version: '1',
})
export class WeiController {constructor(private readonly weiService: WeiService) { }// 动态路由// Request装饰器 或者 Param 装饰器@Get(':id')findId(@Request() req) {console.log('@@@@@@', req.params)return {code: 200,message: '请求成功!!!!!!'}}
}

header信息读取使用@header装饰器

import {Controller,Get,Headers,
} from '@nestjs/common';import { WeiService } from './wei.service';@Controller({path: 'wei',version: '1',
})
export class WeiController {constructor(private readonly weiService: WeiService) { }// 读取header 信息@Get(':id')findId(@Headers() header) {console.log('header', header)return {code: 200,message: '请求成功!!!!!!'}}
}
http://www.hkea.cn/news/161969/

相关文章:

  • win2008sr怎么用iis做网站国外网站加速
  • 合肥++网站建设磐石网站seo
  • 万网主机怎么上传网站如何在百度上投放广告
  • 做网站时如何给文字做超链接全球疫情最新数据消息
  • 四川省住建厅官方网站3分钟搞定网站seo优化外链建设
  • 做网站阳泉巨量千川广告投放平台
  • 温岭哪里有做网站的如何自制网站
  • 知道创于 wordpress搜索引擎优化宝典
  • 乌兰县wap网站建设公司有效获客的六大渠道
  • 微信网站开发教程视频教程百度一下主页官网
  • 网站开发专业前景关键词挖掘排名
  • 网站开发属于什么职位类别seo查询站长工具
  • wordpress postmetaseoul national university
  • 商务网站的主要存在形式杭州百度快照优化公司
  • 个人备案网站做购物网站可以不班级优化大师免费下载电脑版
  • 贸易网站建设互联网广告代理加盟
  • 深圳网站建设网络公司河北关键词排名推广
  • 在工商网上怎么注册公司seo优化博客
  • 免费的小程序怎么赚钱历下区百度seo
  • 河北石家庄最新疫情最新消息优化防疫政策
  • 一站式做网站哪家强新闻小学生摘抄
  • 江西南昌网站建设公司哪家好谷歌google 官网下载
  • 公司网站用什么开发百度指数怎么用
  • 建站主机 wordpress济南网站万词优化
  • 哈尔滨app开发seo自学网官网
  • 网站答辩ppt怎么做全网关键词云在哪里看
  • 网站建设 视频seo关键词词库
  • 网站应用软件设计成都网站建设技术外包
  • 用哪个软件做网站网址查询域名解析
  • 网站安全优化域名停靠浏览器