postman

How to inject interface in module of nestjs app

删除回忆录丶 提交于 2021-01-29 20:14:54
问题 Here is the screenshot of error: I got many answers for this problem but i didn't get any exact proper solution.When i remove UsersModule from below code then i got error of 404 not found in postman.But when i write UsersModule in below code then i got error which is mentioned in screenshot. Here is the code of app module: @Module({ imports: [UsersModule,MongooseModule.forRoot("mongodb://localhost:27017/jwt",{ useNewUrlParser: true })], controllers: [AppController], providers: [AppService] })

How should I format my POST data for testing an express API endpoint?

安稳与你 提交于 2021-01-29 18:20:43
问题 I am following: https://www.digitalocean.com/community/tutorials/getting-started-with-the-mern-stack. I would like to test an API endpoint built using express. I would like to test POST. The node server is running and I am using postman to check if the endpoint is working. I am unclear on how to format the post data and my POST requests result in errors when I send them. My API is below: const express = require ('express'); const router = express.Router(); const Todo = require('../models/todo

Oder of my json request is getting sorted in alphabetical order when i am getting data from data file.i dnt want my json request to get sorted

旧街凉风 提交于 2021-01-29 12:38:01
问题 { "ID":0, "OrganizationId":"", "OrganizationName":"", "Name":"", "IsActive":"True", "Type":2, "AppliesTo":1, "TagHOD":"", "DisplayAsPrimary":"false", "Values":[ ] } Above is my json request which I have stored in a data file Below is my json request body which I am getting after sending a parameter into it. It is sorted into alphabetical order which I don't want. I want the same order as above eg ID Should be first then OrganizationId { "AppliesTo": 1, "DisplayAsPrimary": "false", "ID": 0,

I got a validation pipe's error when am passing email and password in the body of the postman

守給你的承諾、 提交于 2021-01-29 10:19:44
问题 Here is the screenshot of error: Here is the code of DTO: import {IsString, IsInt,IsEmail,IsNotEmpty, IsNumberString, IsIn} from 'class-validator' export class logindto{ @IsEmail() username:String @IsNotEmpty() password:String } Here is the code of controller: @Post('login') log(@Body('username')username:logindto,@Body('password')password:logindto):any{ return this.crudservice.loginsys(username,password) } Here is the code of services: export class CrudService { constructor(@InjectModel(

Inserting/Updating pieces and its fields via (apostrophe-headless) REST API

两盒软妹~` 提交于 2021-01-29 08:12:46
问题 Am am currently using Postman to test the api results. I have been following the apostrophe headless docs, since am completely new to this. so what i need is to submit a post request in Postman to add a piece and its fields from REST api. I have got the bearer token and login was success. but when i insert a piece with body as JSON schema. am getting a error message. May be the way am doing is wrong. so can one one help me in Making a post request to add piece and fields through POSTMAN

Generating RSA JWT in Postman Pre-request script

纵饮孤独 提交于 2021-01-29 07:46:48
问题 I have the following pre-request script that i am using to attempt to generate a JWT for Google Api - Google uses the RS256 encryption which is where I think I am getting stuck - the CryptoJS seems to support HmacSHA256 only - Any advise would be helpful: Here's my pre-request script from Postman: function base64url(source) { // Encode in classical base64 encodedSource = CryptoJS.enc.Base64.stringify(source); // Remove padding equal characters encodedSource = encodedSource.replace(/=+$/, '');

How to modify curl post command in postman

五迷三道 提交于 2021-01-29 06:08:04
问题 I developed POST api and tried to test them by POSTMAN I tried to export to curl command. I get following code. curl --location --request POST 'http://localhost:3000/user' --form 'loginId=hikaru' --form 'password=test' But,when I test such code,empty body was sent to server. instead that, I modified to the following code. This code can sent data to server. curl --data "loginId=hikaru&password=test" http://localhost:3000/user I'd like to know how to change curl structure via POSTMAN GUI.

Postman这个操作你得知道

人走茶凉 提交于 2021-01-29 04:45:19
“ 还在愁接口测试工具之间如何共享数据,而不是把接口再进行写一遍。 ” 前言 之前的接口测试都使用的是postman,最近将调整为Talend Api Tester。 于是就有一个很大的问题,所有的接口信息都在postman上,如何导入到alend Api中。 问题很大老铁 跟随着这个问题我们来一起发现测试工具中的新大陆。 一、从头开始 既然要对测试工具有一个新的认识,那就应该从头开始。 为了测试方便,咔咔就先建立一个集合为A api集合 然后在集合A里边新添加一个请求,下图就是添加成功的图 一个新的请求 这样的请求有一个很大的弊端就是当域名发生改变时,那么在这个集合下的所有接口都需要修改请求域名。 针对这一需求Postman是早已经给准备好了。 添加环境变量 添加成功后就可以在这里看到刚刚添加的环境变量了 环境变量 然后将刚刚的请求域名改为 {{host}} 即可,发送请求依然可以获取到数据。 修改为host发起的请求 做完以上几个操作后,我们一个完整的集合就创建的差不多了,接下里就需要回归正题。 继续针对文章开头说的互相转换接口数据。 二、Postman与Postman互通数据 其实在Postman中存在着几种方式的数据互相导入。 这里咔咔给大家介绍其中的俩种方式,第一种通过分享链接、第二种是导出为json文件。 俩种方式都可以将接口数据导入到另一个postman中。

OneDrive OAuth 2.0 and Postman Sanity Check

牧云@^-^@ 提交于 2021-01-28 23:32:52
问题 I am trying to generate a OAuth Token for OneDrive by using Postman. I just wanted to ask for clarification as to what the Auth URL, Access Token URL and scope would be? I have tried it with: Auth URL: https://login.microsoftonline.com/common/oauth2/v2.0/authorize Access Token URL: https://login.microsoftonline.com/common/oauth2/v2.0/token Scopes: wl.signin However, I keep getting an error around the scope is not correct. Just for sanity check are these the correct settings? 回答1: Please refer

Passing List object and int to web api

回眸只為那壹抹淺笑 提交于 2021-01-28 23:09:55
问题 I have a web api core project that if I send just the list parameter than the API receives the values, however if I send both parameters that the controller is looking for then both parameters are seen as null My contoller: [HttpPost] [Route("/jobApi/RunBD")] public int RunBDReport([FromBody]int month, [FromBody] IEnumerable<ClientModel> clients) { billingDetailCycle objBillDetail = new billingDetailCycle(); if (ModelState.IsValid) { return objBillDetail.Run(clients.ToList(), month); } else {