© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
4 replies
İrşat

I can't get fetch body as plain string [Answered]

public async Task<JsonResult> GoogleSignin([FromBody] string googleToken)
public async Task<JsonResult> GoogleSignin([FromBody] string googleToken)

await fetch("/Auth/GoogleSignin", {
        method: 'POST',
        headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json'
        },
        body: response.credential
    })
await fetch("/Auth/GoogleSignin", {
        method: 'POST',
        headers: {
            'Accept': 'application/json',
            'Content-Type': 'application/json'
        },
        body: response.credential
    })
Normal text instead of response.credential also doesn't work. I used json stringfy, object etc, didn't work
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements