nativescript-community / https

Secure HTTP client with SSL pinning for Nativescript - iOS/Android
https://nativescript-community.github.io/https/
Other
51 stars 42 forks source link

[iOS] Content/body not sent using POST #75

Closed sivo1981 closed 3 years ago

sivo1981 commented 3 years ago

Bellow code is working fine on Android, but on iOS content / body is not sent to the server.

const response = await Https.request({
  useLegacy: true,
  method: 'POST',
  url: `${baseUrl}${url}`,
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
  content: stringify(body),
})

Tried with useLegacy=false and useLegacy=false and there is no difference.

Using latest version of NS7 and HTTPS.

Any ideas?

farfromrefug commented 3 years ago

@sivo1981 try to use body:body instead of content: stringify(body) . This is what i do

sivo1981 commented 3 years ago

@farfromrefug Thanks for the hint. Meanwhile i have found out that maually setting cookie to header (aka. remember-me) also doesnt work as i expected, so i switched to axios.