Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS Response headers #45

Open
fofaria opened this issue Jul 10, 2019 · 2 comments
Open

iOS Response headers #45

fofaria opened this issue Jul 10, 2019 · 2 comments

Comments

@fofaria
Copy link

fofaria commented Jul 10, 2019

When performing a HTTP request (any HTTP Verb), for the iOS, the response of the plugin has headers as an empty object: {}.

After a some investigation, it's clear that line 125 of https.ios.js, is always undefined and therefore we never get all headers from response. (AFResponse.task.response is always undefined)

    **var response = AFResponse.task.response;**
    if (!types_1.isNullOrUndefined(response)) {
        sendi.statusCode = response.statusCode;
        var dict = response.allHeaderFields;
        dict.enumerateKeysAndObjectsUsingBlock(function (k, v) {
            sendi.headers[k] = v;
        });
    }
    if (AFResponse.reason) {
        sendi.reason = AFResponse.reason;
    }
    return Promise.resolve(sendi);
});

Does anyone has the same issue? Or is there any workaround to get the headers from the response?

Thank you. @jeffwhelpley

@farfromrefug
Copy link
Member

@fofaria i have the exact same issue right now. Investigating

@fofaria
Copy link
Author

fofaria commented Jul 12, 2019

@farfromrefug thanks for the reply. Through Nativescript slack channel I got this answer as a workaround NativeScript/ios-jsc#1149
see if it helps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants