Use the ngImgCrop
plug-in to generate base64
data. When using $http.post()
to pass base64
data, a 414
error occurs, indicating that the parameter is too large.
Looking for a solution, I don’t want to use 原生的 ‘form post’ 请求
. Waiting online...
//*** 省略URL ***//
....
//----参数
_params={image_url:$scope.cropper.croppedImage,name:_form.name}
//----请求
$http({
method:"POST",
url:_url,
params:_params,
headers:{'Content-Type':'application/x-www-form-urlencoded'},
transformRequest:angular.identity
});
How did you post it? Up code
Supplement
Judging from your code, your approach is to put the parameters after the URL, similar to:
But
post
it is best to put the parameters in the requestBody. The code is simpler than you think:That’s good