Correct content-type for sending this AJAX Post data
问题 I am having problem sending base64 image data using ajax post I think I have the wrong value for Content-Type but have tried application/json , text/json and image/jpeg without any success Javascript function sendFormData(fD) { var urls = fD.get('urls'); console.log('urls', urls); var xhr = new XMLHttpRequest(); xhr.open('POST', '/editsongs.update_artwork'); alert(urls); xhr.setRequestHeader("Content-type", "image/jpeg"); xhr.send(urls); } Browser console shows ["data:image/jpeg;base64,/9j