create listener to http post request in asp.net mvc 4

2.9k Views Asked by At

I have to receive 'call back' from interfax API. When a user (having account) on interfax receives a fax, it gives a call back to the account holder on a specified URL that must be able to receive Http Post request. The guidance is here Accepting incoming fax notifications by callback.

I created a a controller and action "Index" as

public string Index()
    {
        try
        {
            Ifax ifax = new Fax();
            ifax.UserId = Convert.ToString(Request.QueryString["userId"]);
            ifax.Id = Convert.ToInt32(Request.QueryString["id"]);
            ---
            ---
            ifax.Save()
         }
}
catch(Exception ex)
{
    //handle exception
}
    //Just saving to db 'true' or 'false', to know if callback receive.
    //SaveFlag();
}

When I receive fax in my interfax account, I get call back on my webserver. But the problem is that I am not getting data. I get every variable null or empty. Am I using a correct way to receive http post request from any client api?

1

There are 1 best solutions below

1
On BEST ANSWER

As I understand Interfax sends a Post request to your application. since its a post request you should be able to read posted values Request["phoneNumber"]

How to retrieve form values from HTTPPOST, dictionary or?