AnsweredAssumed Answered

esriRequest returnes "415 Unsupported media type" with js aspi 4.12

Question asked by denis.pokotylyuk@geodata.no_Geodata on Jul 16, 2019
Latest reply on Jul 16, 2019 by NSager-esristaff

Hi,

 

After update form 4.11 to 4.12 posting of data stopped to work.

 

export const postActivityLog = (activityDTO: ActivityLogDTO): Promise<any> => {
return new Promise((resolve, reject) => {
esriRequest(`${activityAPI}/activityLog`, {
method: 'post',
responseType: 'json',
query: JSON.stringify(activityDTO),
}).then((result: any) => {
resolve(result.data);
}).catch(error => {
reject(error);
});
});
};

 

This code worked correct in 4.11, see image.

 

With 4.12 I get:

Status Code: 415 Unsupported Media Type
Content-Type: application/problem+json; charset=utf-8
Form data:
    1. 0:
      {
    2. 1:
      "
    3. 2:
      a
    4. 3:
      c
    5. 4:
      t
    6. 5:
      i
    7. 6:
      v
    8. 7:
      i
    9. 8:
      t
    10. 9:
      y
    11. 10:
      I
    12. 11:
      d and so on...
See image with Network log.JS API 4.11. Works correct!
JS API 4.12 Does not work!

Outcomes