javascript - Json Data type without Stringify to MVC Controller -


i have mvc controller have string parameter.

  [httppost]         public string index(string data)         {                 return data.tostring();          } 

and webhook respond this.

{"data":{"estimated_value":hello}} 

the problem data null when debug on , have no way of controlling response webhook , controlled web app.

i try use postman have content-type of application/javascript json

now if try post kind of json, data

{"data":"mydata"} 

i return of mydata if parameter (string data) exact data object json, how can entire thing object. [without creating class serialization] need either object or plain string.

also if try add more parameters, first parameter getting omitted. might use class creation first have know how data with

{"data":{"mydata":23232}} 

this kind of format.

steps have tried far. 1. create class xamasoft json class generator. 2. change parameter object: result {object}; 3. change parameter jsonresult. still null. 4. added array string[]. result. still nothing; 5. added [system.web.http.frombody] parameter. same result;

updated question

so stephen muecke had answered correctly , unfortunately in comment again.

i have added question query not have ask again in different context.

so how can data if json return in format.

{"data":{"estimated_value":[{"index":0, "address": "128 myhome"},{"index":1, "address": "531 myappartment"}] }


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -