Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Swagger - Error: Bad Request ( 400 ) #9233


User avatar
0
andrebretas created

Hi!

I'm using aspnetzero 8.9.1. Why the APIs return bad request ( Error 400 ) while called from Swagger UI and works as expected when called from Angular UI?

Thanks.


3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    hi

    You can try to clear your browser's website cookies, or try in the browser's incognito mode.

  • User Avatar
    0
    lweng567 created

    Hi,

    We have recently downloaded the ASP.NET Zero source (ASP.NET CORE & Angular) as separate solutions.

    We can run the Api (Web.Host) without issue via our IDE (Visual Studio) but when we follow the steps to publish to IIS (https://docs.aspnetzero.com/en/aspnet-core-angular/latest/Deployment-Angular-Publish-IIS) we are getting a HTTP Error 404 when we browse to the Api URL (e.g. http://localhost:[port]).

    We can manually amend the Api URL (e.g. http://localhost:[port]/swagger/index.html) and see the Api endpoints but we are not prompted to login/authenticate.

    Do you have any suggestions on what we are missing/doing wrong? Let us know if you need any screenshots, etc.

    Thanks in advance.

    Laurie

  • User Avatar
    0
    maliming created
    Support Team

    Hi @lweng567

    Please create a new question. Thanks.