다음과 같은 조치가 있습니다.
[HttpPost]
[Route("api/client/log")]
public void SetClientLog([FromBody]string error)
{
ClientLogger.LogError(error);
}
그리고 각도에서 로그가 문자열 인 다음을 게시하려고합니다.
$http({
method: 'POST',
url: "api/client/log",
data: log,
headers: {'Content-Type': 'application/json'}
});
값 앞에 "="를 붙이고 올바른 Content-Type을 설정했는지 확인하십시오.
$http.post('api/Companies/Search', "="+$scope.query, {
headers: { 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8' }
})
.success(function (data, status) {
$scope.result = data;
})
.error(function (data, status) {
$scope.data = data || "Request failed";
$scope.status = status;
});
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다