S
S
slink75762018-06-01 19:09:54
ASP.NET
slink7576, 2018-06-01 19:09:54

How to properly pass data to ASP.NET?

There are two types of data transfer: through JObject and using routing.
Example:
/api/user/add/{name}/{age}/{salary}
post(string name, string age, string salary)
{}
and second:
/api/user/add
post(JObject obj)
{
Parse obj
}
Help to understand what method is correct to use.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
MrDywar Pichugin, 2018-06-01
@slink7576

https://docs.microsoft.com/en-us/azure/architectur...
/api/user for
more HTTP verbs.
For POST, PUT data will be in the body of the request.
For GET, DELETE the data will be in the URL.
No need to write
/api/user/add
/api/user/1/rename
/api/user/1/delete

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question