c# - Can't use Acumaica RestAPI - Stack Overflow

I currently host Acumatica on my computer. I was able to access the Acumatica website (localhost) via t

I currently host Acumatica on my computer. I was able to access the Acumatica website (localhost) via the browser. However, when I try to log in via Postman, I keep getting error code 400. What do I have to do so that I can log in via Postman? I am only doing this to test if the API works, which I want to include in my C# code.

Postman Body:


    {
        "name": "admin",
        "password": "admin"
    }

POST: http://127.0.0.1/SmartFix_T190/entity/auth/login

ERROR:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"".dtd">
<HTML>

<HEAD>
    <TITLE>Bad Request</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
</HEAD>

<BODY>
    <h2>Bad Request - Invalid Hostname</h2>
    <hr>
    <p>HTTP Error 400. The request hostname is invalid.</p>
</BODY>

</HTML>

I currently host Acumatica on my computer. I was able to access the Acumatica website (localhost) via the browser. However, when I try to log in via Postman, I keep getting error code 400. What do I have to do so that I can log in via Postman? I am only doing this to test if the API works, which I want to include in my C# code.

Postman Body:


    {
        "name": "admin",
        "password": "admin"
    }

POST: http://127.0.0.1/SmartFix_T190/entity/auth/login

ERROR:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3./TR/html4/strict.dtd">
<HTML>

<HEAD>
    <TITLE>Bad Request</TITLE>
    <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii">
</HEAD>

<BODY>
    <h2>Bad Request - Invalid Hostname</h2>
    <hr>
    <p>HTTP Error 400. The request hostname is invalid.</p>
</BODY>

</HTML>
Share Improve this question asked Mar 4 at 11:15 SiboSibo 1 2
  • Could you add a screenshot about your postman request? – Zoltan Febert Commented Mar 4 at 14:09
  • Replace the loopback IP 127.0.0.1 With the Name or IP of the machine. Is the machine a Virtual Machine? – jdweng Commented Mar 4 at 17:41
Add a comment  | 

1 Answer 1

Reset to default 1

I believe you might be querying the wrong IP address. Have you tried opening your instance using the same IP in your browser?

Please verify your IP address and replace it with 127.0.0.1. You can then make the API call from Postman to your Acumatica instance.

For example:

http://localhost/test/entity/auth/login

If you are using the same computer where the instance is hosted, you can simply use localhost instead of the IP address.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745047692a4608195.html

相关推荐

  • c# - Can&#39;t use Acumaica RestAPI - Stack Overflow

    I currently host Acumatica on my computer. I was able to access the Acumatica website (localhost) via t

    8小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信