0

My Godaddy remote hosted web API http://impexmail.co/api/Departments/Getdepartments responds to get and post requests from Postman and HTML with jQuery but not responding to Blazor WASM. With the same blazor WASM methods I can reach and get to for example https://jsonplaceholder.typicode.com/todos.. Any suggestions appreciated.

2 Answers 2

0

You making a call to a HTTP resource from HTTPS. This is blocked by Blazor. Docs are here.

I would upgrade your api to be https. Alternately you could run your app in http. You could override the policy's but I think you have a cors problem then.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. It worked after I installed nuget cors package and corrected enable cors in web api controllers, web api config. I also had to deselect https in blazor wasm.
0

I too think you have a CORS issue as mentioned by Brian Parker. You need to enable CORS on your Web API and re publish it to your shared hosting account. Check out Microsoft documentation below for enabling it in your project.

https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-3.1

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.