Skip to content

Headers on iOS not intercepted from httpclient #2385

@MTurskiSPTech

Description

@MTurskiSPTech

Describe the bug
RestResponse on iOS doesnt get the same headers, nor sets the cookies as it does on an android.
HttpClient does. Ability to provide backend information is next to none, i'd classify the project as legacy.

To Reproduce
No idea if this is backend reliant. Problem got noticed on a MAUI app when calling our auth/token endpoint with simple credential params. I have no idea how does one reproduce such a thing.
Probably you'd need to call from both platforms an endpoint that is supposed to return "Set-Cookie" header and compare.

Expected behavior
Same header and cookies as on an android platform.

Desktop (please complete the following information):

  • OS: 26.4.1
  • .NET 10.0
  • Version 112/114

Additional context

i fired two of the same requests, one with RestClient and one with HttpClient, logged the headers, cookies, and body. Here it is with redactions.

===== [DIAG] RestSharp response headers START =====
[DIAG][RestSharp Header] Server: nginx
[DIAG][RestSharp Header] Date: Mon, 25 May 2026 10:47:27 GMT
[DIAG][RestSharp Header] Connection: keep-alive
[DIAG][RestSharp Cookies Count] 0
[DIAG][RestSharp Content] {"access_token":"[...]","token_type":"bearer"}
===== [DIAG] RestSharp response headers END =====
===== [DIAG] HttpClient response START =====
[DIAG][HttpClient] StatusCode: OK
[DIAG][HttpClient] All response headers:
[DIAG][HttpClient Header] Server: nginx
[DIAG][HttpClient Header] Date: Mon, 25 May 2026 10:47:32 GMT
[DIAG][HttpClient Header] Connection: keep-alive
[DIAG][HttpClient Header] Set-Cookie: refresh-token=[...]; Path=/; Domain=api.domain.org; Version=0; Expires=Wed, 24 Jun 2026 10:47:32 GMT; Secure; httponly
[DIAG][HttpClient] Content headers:
[DIAG][HttpClient Content-Header] Content-Type: application/json
[DIAG][HttpClient Content-Header] Content-Length: 2636
[DIAG][HttpClient] CookieContainer cookies count: 1
[DIAG][HttpClient Cookie] refresh-token=[...] (Domain=api.domain.org, Path=/, HttpOnly=True, Secure=True)
[DIAG][HttpClient Body] {"access_token":"[...]","token_type":"bearer"}
===== [DIAG] HttpClient response END =====

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions