React Native Code
Код: Выделить всё
const formData = new FormData();
formData.append('Images', [
{ uri: selectedImage.uri, name: selectedImage.fileName, type: selectedImage.type },
] as any);
const headers = {
Authorization: `Bearer ${await getToken()}`,
'Content-Type': 'multipart/form-data',
};
const res = await api.post(url, formData, {
headers,
transformResponse: () => formData,
responseType: 'json',
data: formData,
});
return res;
Спасибо!
Подробнее здесь: https://stackoverflow.com/questions/786 ... sp-net-api