Skip to content
This repository was archived by the owner on Nov 27, 2018. It is now read-only.

HttpPost route receive 404 Not Found on Azure #257

Closed
felipesantanadev opened this issue Dec 15, 2015 · 2 comments
Closed

HttpPost route receive 404 Not Found on Azure #257

felipesantanadev opened this issue Dec 15, 2015 · 2 comments

Comments

@felipesantanadev
Copy link

I have a WebApp on Azure, but any HttpPost route receive 404 Not Found.

All the HttpGet routes work fine, but all the HttpPost routes don't work.

This happens only on Azure, that is, in the localhost the HttpPost route works normally.

Here is an example:

[Route("contact")]
public class ContactController : Controller
{
    private IContactMessageRepository _contact;
    private ILogService _log;
    public ContactController(IContactMessageRepository contact, ILogService log)
    {
        _contact = contact;
        _log = log;
    }


    [HttpPost("send")]
    [ValidateAntiForgeryToken]
    public async Task<ActionResult> SendMessage(ContactMessageViewModel model)
    {

    }
 }

...azurewebsites.net/contact/send -> NOT FOUND
localhost/contact/send -> WORKS FINE

I'm trying to POST throught ajax.

I have already enable CORS.

@Eilon
Copy link
Contributor

Eilon commented Dec 30, 2015

What if you remove the ValidateAntiForgeryToken?

@Eilon
Copy link
Contributor

Eilon commented Dec 30, 2015

Dup of aspnet/Mvc#3769.

@Eilon Eilon closed this as completed Dec 30, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants