웹 API 메서드를 호출하고 있습니다.자바 스크립트의 전통적인 쿼리 문자열 매개 변수 #
API 방법 :
사실//get
public bool GetShoppingElementDetails(ElementSearchParameter elementSearchParameter)
{
}
class ElementSearchParameter{
public string name;
public list<int> ids;
}
그 방법은 get 메소드입니다, 그래서 내가 어떻게 그 기능에 multidimention 배열 매개 변수를 전달할 수 있습니다, 내가 같은 생각
, JQuery와 프레임 워크는 전체 개체를 변환한다 "traditional = true"를 사용하여 올바른 쿼리 문자열로 변환하므로 mvc 컨트롤러가 완벽하게 구문 분석합니다.C와 동일한 방식으로하고 싶습니다. 다음과 같은 뭔가,
ElementSearchParameter toSearch = new ElementSearchParameter{};
//convert the tosearch object into string object (parsing like jquery)
string toSearchString = ...
HttpResponseMessage response = httpManager.Client.GetAsync(string.Format(_routePrefixMeta + "/OrderOffering/Elements/search/{1}", programID, toSearchString)).Result;
return httpManager.ConstructData<List<OfferElementType>>(response);
저는 C#에서 호출하는 javascript에서 컨트롤러 메서드를 호출하지 않습니다. (WEB-API) – sathishkumar