나는이 자바 스크립트 코드 조각이 : 나는 전화를 걸 때HTTP POST를 방법 HTTP GET 방법
[HttpPost]
public List<ItemStatistiquesPointageMonth> GetPointages(Nullable<System.DateTime> laDate = null, List<Collaborateur> lstcols =null, Nullable<int> lEquipe = null, int Type = -1)
가의 경호 국은 다음과 같습니다
$.ajax({
type: "Post",
contentType: 'application/json',
url: "../api/Pointage/GetPointages",
data: JSON.stringify({
laDate: DateConsultation,
lstcols: Collaborators,
lEquipe: equipe,
Type: 3,
}),
success: function (data) {
console.log(data);
call3(data);
}
});
서비스 메소드의 서명이 다음입니다 도달 할 수 없다 !!
그래서이 문제의 이유는 무엇입니까? 어떻게 해결할 수 있습니까?
시도가'대신 type''의 method' - 우리가 아약스 호출에서 볼 수 있듯이 내가 jQuery를 모두 지원합니다 생각하지만, 여기에 –
(아마도 JQuery와 버전에 따라 다름), 당신은 데이터 트로프 몸,하지만 방법에 전달하는에이 '[FromBody]'를 선언하지 말고, 어떻게 여러 개의 매개 변수를 이런 식으로 전달할 수 있습니까? –
@Div가 지적했듯이, 그 속성을 가진 모델을 생성 해보고 대신 액션 인수로 사용 해보십시오. –