javascript - Fetch API: FormData vs URLSearchParams



application/x-www-form-urlencoded vs multipart/form-data

According to this link:

If you have binary (non-alphanumeric) data (or a significantly sized payload) to transmit, use multipart/form-data. Otherwise, use application/x-www-form-urlencoded.

FormData vs URLSearchParams in Fetch API

According to this link:

Class Default Content-Type
String text/plain;charset=UTF-8
URLSearchParams application/x-www-form-urlencoded;charset=UTF-8
FormData multipart/form-data
Blob inherited from the blob.type property