This is Google API - Javascript code
var output = new Object();
output.PlaceID = place.place_id;
output.Longitude = place.geometry.location.lng();
output.Latitude = place.geometry.location.lat();
$.ajax({
headers: {
'Accept': 'application/json',
'Content-Type': 'application/json'
},
url: 'api/StorePlaces/Get',
type: 'POST',
data: { "value":output },
success: function (result) {
// Do something with the result
}
});
How to receive at the controller
// GET api/values/5
[HttpPost("{PlaceDetails}")]
public string Get(PlaceDetails value)
{
return "value";
}
In this case I get null value
I was unable to send the string , if I can send the Object as such, it is better.
This can be used as receiving object
public class PlaceDetails
{
public string PlaceID { get; set; }
public string Longitude { get; set; }
public string Latitude { get; set; }
}

data:outputand remove[FromBody]