Welcome! Log In Create A New Profile

Advanced

Re: Can someone explain me why "curl: (7) Failed to connect to 127.0.0.1 port 2000: Connection refused" ?

May 13, 2020 10:18AM
I solved it .
It was mix of small little problems that together hindered the correct answer:
- changed in golang webserver HOST = 127.0.0.1
- capitalized the first letter of each element of the Puser struct in order to make it visible to json decoder
- used correctly the curl command:

curl -d'{"first_name":"pinco", "last_name":"pallo", "company_name":"Company","email":"pinco.pallo@company.com","tel":"111111111"}' -H "Content-Type: application/json" 127.0.0.1:2000/puser/add
[{"First_name":"pinco","Last_name":"pallo","Country":"","Company_name":"Company","Email":"pinco.pallo@company.com","Tel":"111111111"}]
Subject Author Posted

Can someone explain me why "curl: (7) Failed to connect to 127.0.0.1 port 2000: Connection refused" ?

MarcoI May 13, 2020 05:52AM

Re: Can someone explain me why "curl: (7) Failed to connect to 127.0.0.1 port 2000: Connection refused" ?

MarcoI May 13, 2020 10:18AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 118
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready