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

HttpPost route receive 404 Not Found on Azure #3769

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

HttpPost route receive 404 Not Found on Azure #3769

felipesantanadev opened this issue Dec 15, 2015 · 3 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 Eilon modified the milestone: 6.0.0-rc2 Jan 26, 2016
@Eilon
Copy link
Contributor

Eilon commented Jan 26, 2016

@javiercn can you try to repro this in Azure?

@javiercn
Copy link
Member

@itsfelipesan can you please provide us the following information to help investigate the bug?
Target framework (CLR, Core CLR)
Version of the MVC package used (Beta8, RC1)

Stack trace/logs/response from the server.
Stack trace/logs of the Console Developer Tools in the browser.
.
Is it CORS enabled on Azure Websites?
jQuery code used to do the post request?
Startup code used to configure CORS?

I was able to successfully create two apps, upload them to azure websites, send a cross domain request and get the response.

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

3 participants