Forum Discussion

c0d3ninja's avatar
c0d3ninja
Copper Contributor
Aug 23, 2024

How to post using jquery to asp.net core api

I'm trying to develop a simple app to post to an api using jquery. I've tried multiple online suggestions and none of them work. I've even tried some of the AI code without success.

 

I can get GET to reply back with data but POST is just not working. Going on my 3rd day on this. Please help.
This is my api code:

 

This is what I'm trying.

 

Thanks for your time.

 

 

1 Reply

  • ardaakkaya's avatar
    ardaakkaya
    Copper Contributor
    Hi,
    It seems like you are returning a Redirect result and trying to parse it like JSON. You should return a JSON to get results. Or you can use http status code for verifying process is done.