【发布时间】:2020-10-10 15:20:22
【问题描述】:
我正在使用 spring 框架,当我尝试使用 postman 注册用户时,我一直在控制台中收到此错误,所以我无法注册用户
POST http://localhost:8080/api/auth/signup
Error: connect ECONNREFUSED 127.0.0.1:8080
Request Headers
Content-Type: application/json
User-Agent: PostmanRuntime/7.25.0
Accept: */*
Postman-Token: c8f92e31-e8f6-40d9-90b0-2bd4faba0552
Host: localhost:8080
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Request Body
{
"username":"TestUserX",
"email":"TestUserX@bla.com",
"password":"password1"
}
【问题讨论】:
-
请在发出此请求时添加您编写的代码和您的Spring应用程序生成的日志。
-
@Ferdinand,我猜你的服务器没有在 8080 运行。请验证服务器是否在运行。
-
@jrhamza 我如何验证?
-
@MeetK。可能是 Github 链接,因为它有很多代码! github.com/ferdinandmwal123/SpringRedditClone
-
@Ferdinand,您可以在 application.properties 中检查 server.port。如果未指定,请在启动应用程序时检查控制台的默认端口。从 Eclipse 启动应用程序时,我可以在 Eclipse 控制台中看到服务器端口。
标签: java spring spring-boot spring-mvc spring-security