Web API Blazor Assembly test api on postman
hy i tried to create a simple API using blazor web assembly and try to get id with postgresSQL, after testing it on postman it return this HTML code? did i do something wrong here?
7 Replies
Blazor wasm is a SPA tech, essentially replacing JavaScript like react
If you just want an API, you should create an asp.net webapi project
ooh okay, im trying to do something new, i thought Blazor Server App work same like asp.net webapi.
Blazor is for front end. It can consume an API but you won't use it for hosting the API
wait then why would they put this in here?
i tried adding an testing API in here and wanted to call it, but no luck.
that would be the wasm hosted model.... the client interacts with the server for things like querying your database. So the server side could have api endpoints for the client to use
As for your issues, you must be doing something wrong somewhere along the way
yes, but i dont know where to start.. tried debug mode and got no clue what is it....