在邮递员中连接ECONNREFUSED

编程入门 行业动态 更新时间:2024-10-28 08:16:36
本文介绍了在邮递员中连接ECONNREFUSED的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试通过邮递员测试我的REST API,但出现以下错误:

I am trying to test my REST API through postman and I am getting the following error:

这是我编写的第一个REST API,对于邮递员来说我是一个新手,所以不确定我在做什么错.以下是我尝试使用此URL用邮递员致电的代码.我在网址中传递了两个日期参数

This is my first REST API that I have written and I am very new to postman so not sure what am I doing wrong. Below is my code that I am trying to call in postman with this URL. I am passing two date parameters in the URL

localhost:44360/api/RecLoadPrime/insertRecLoadData/?RecStartDate=01/01/2020&RecEndDate=01/02/2020

下面是代码:

using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using RecLoad.DAL; namespace RecLoad.Controllers { [Route("api/[controller]")] [ApiController] public class RecLoadPrimeController : ControllerBase { [Route("RecLoadPrime/insertRecLoadData/{RecStartDate}/{RecEndDate}")] [HttpPost] public void insertRecLoadData(string RecStartDate, string RecEndDate) { RecLoadDataProvider dataProvider = new RecLoadDataProvider(); dataProvider.InsertData(RecStartDate, RecEndDate); } } }

在其他选项卡下,授权,标头,正文,PreRequest脚本,邮递员的测试和设置下没有任何内容.以下是邮递员的屏幕截图:

There is nothing under the other tabs, Authorization, Headers, Body, PreRequest scripts, Test and settings of postman. Below is the screen shot from postman:

当我尝试通过将URL放置在浏览器中直接运行API时,出现错误消息:

when I trying to run the API directly by putting this URL in the browser, I am getting the error saying:

This localhost page can’t be foundNo webpage was found for the web address: localhost:44360/api/RecLoadPrime/insertRecLoadData/?RecStartDate=01/01/2020&RecEndDate=01/02/2020

任何帮助将不胜感激.

推荐答案

我遇到了同样的错误.这解决了我的问题:

I was getting the same error. This solved my issue:

文件->设置->代理,然后取消标记使用系统代理"

File -> Settings -> Proxy, then unmark "Use the system proxy"

请注意,我仅将Postman用于开发(本地主机),因此我禁用了代理.

Notice that I'm using Postman only for development (localhost), so I disabled the proxy.

更多推荐

在邮递员中连接ECONNREFUSED

本文发布于:2023-10-29 04:22:46,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1538714.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:邮递员   ECONNREFUSED

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!