Search code examples
vue.jsionic-frameworkjson-rpccapacitor

JsonRpc request from ios 12 sends empty content


I am using vue-json-rpc-client-fetch-withcredentials for comunication with my api via jsonRpc in my ionic5/vue project. Comunication works fine in browser and ios 13 (devices and simulators), but when i running app on ios 12, request’s response is "Invalid request". The reason of invalid request is, that reguest’s content is empty. Does anyone know why? I am using Capacitor to create ios version. I tried to create request with another ways, but i have still the same error.


Solution

  • I changed setting for headers on API server and it's working now. So, it's really the difference between

    header('Access-Control-Allow-Headers: *');

    and

    header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}");