我正在使用ckeditor5的simple upload adapter在laravel 6项目中上传图像。在我的刀片视图文件中,我有以下代码:
<script>
ClassicEditor
.create( document.querySelector( '#description' ), {
simpleUpload: {
// The URL that the images are uploaded to.
uploadUrl: "{{ route('images.store') }}",
// Headers sent along with the XMLHttpRequest to the upload server.
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
},
}
} )
.catch( error => {
console.error( error );
} );
</script>
我想通过图像上传ajax请求发送以下数据-
{
"reportImage" : "1"
}
我该如何实现?
您可以通过标题发送它。