我在angularjs中做了一个$http调用
url="data/someJson.json";
$http.get(url).then(function(data){
var requiredContent = data.requiredContent;// Case 1
var requiredContent = data.data.requiredContent; // Case 2
});
someJson的含量为{"requiredContent": {"a":"b"}};。
如
作为一个新的角度,我准备如何调用一个web服务,应该通过URL进行解析和映射,就像URL被直接调用以获得具有给定参数的列表请求一样。
我的意思是说我有
/api/products -- calling all products(this is the access point)
/api/products/?page=2&orderby=asc -- calls products with pagination and orderby and here is what's bothering me becaus
我有多个Web Api Post methods,比如:
[HttpPost]
public async Task<IHttpActionResult> Post([FromBody] AdModel adModel)
{
//Post
}
[HttpPost]
[Route("AddToWatchList")]
public async Task<IHttpActionResult> AddToWatchList(int adId)
{
// Post t