Reputation: 65
I have this code where there are multiple Content-type
keys is used in this POST request. When this request is run I always get an error that a duplicate key is used. I want to know how I can use multiple Content-type
in one Content-type
key. The header of the request looks like below:-
headers: {
'Content-Type':'application/json,
'Access-Control-Allow-Origin': '*',
'Content-Type': 'multipart/form-data; charset=utf-8; boundary=' + Math.random().toString().substr(2)
}
Upvotes: 0
Views: 4904
Reputation: 45970
You can’t. Are you sending JSON or Form-Data? It can’t be both so has to be one or the other.
Upvotes: 1