Closed qidizi closed 1 year ago
request:
// node global.FormData,not npm form = new FormData(); form.set('imN_notRN','a\na'); // print : imN_notRN value "a\na" console.log('imN_notRN value',JSON.stringify(form.get('imN_notRN'))) // php "echo json_encode($_POST);" will print : { imN_notRN: 'a\r\na' } console.log (await got({ url: 'http://127.0.0.1:8000/?', method: 'POST', body: form, responseType: 'json' }).json());
php "echo json_encode($_POST);" will print : { imN_notRN: 'a\na' }
a\na
...
https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart-form-data
Describe the bug
Actual behavior
request:
Expected behavior
php "echo json_encode($_POST);" will print : { imN_notRN: '
a\na
' }Code to reproduce
Checklist