Skip to content

iOS Response headers #45

@fofaria

Description

@fofaria

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions