tyler.brandt's avatar

Uploading a file to a Laravel POST route through my C# desktop application and I'm getting CSRF mismatch errors

Hi, the title pretty much sums up what I'm trying to do. The function in Laravel that is attached to my POST route does some basic processing that I want to keep out of my desktop application (one part of which is choosing a new file name), and should return the file name that it will be stored under on the server. The problem is that every time I try to do a POST from my C# application it returns a CSRF token exception. Is there any way around this? The C# application wouldn't have gotten a token in the first place, since there is no web session, just a file upload to a function in Laravel. Is there something obvious that I'm overlooking? I am familiar with using CSRF tokens in my web forms in blade template files, but I have never tried to get a C# application to talk to Laravel.

0 likes
2 replies

Please or to participate in this conversation.