C
C#4mo ago
Nefario

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?
No description
7 Replies
Pobiega
Pobiega4mo ago
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
Nefario
Nefario4mo ago
ooh okay, im trying to do something new, i thought Blazor Server App work same like asp.net webapi.
Anu6is
Anu6is4mo ago
Blazor is for front end. It can consume an API but you won't use it for hosting the API
Nefario
Nefario4mo ago
wait then why would they put this in here?
No description
Nefario
Nefario4mo ago
i tried adding an testing API in here and wanted to call it, but no luck.
No description
Anu6is
Anu6is4mo ago
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
Nefario
Nefario4mo ago
yes, but i dont know where to start.. tried debug mode and got no clue what is it....