From a separate web application (non Umbraco) in this way:
var values = new NameValueCollection();
values["property1"] = "hello";
values["property2"] = "world";
using (var client = new WebClient())
{
var response = client.UploadValues("http://raes.local/Umbraco/Api/WebMethods/CreateUpdateEvent", "POST", values);
String responseString = Encoding.Default.GetString(response);
}
The issue is that the POST is triggering but the data from the [FromBody] of the post is always null. In other words I am not able to get the object sent via the POST.
UmbracoApiController method gets always Null data from POST
Hi guys, I am new on this forum and I am struggling a lot with something that theoretically should be easy.
I am calling a WebMethod in Umbraco that looks like this:
public class WebMethodsController : UmbracoApiController {
}
From a separate web application (non Umbraco) in this way:
var values = new NameValueCollection(); values["property1"] = "hello"; values["property2"] = "world";
}
The issue is that the POST is triggering but the data from the [FromBody] of the post is always null. In other words I am not able to get the object sent via the POST.
Am I missing something?
Thank you in advance!!!
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.