Closed AllDmeat closed 2 years ago
This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.
I just ran into the same issue using Alamofire 5 with the Session.request(_:method:parameters:encoder:headers:interceptor:requestModifier:)
method.
httpBodyArguments
is now just nil in the tests mock.onRequest handlers :-(
This issue is stale because it has been open for 30 days with no activity. Remove the Stale label or comment or this will be closed in 10 days.
I'm sending array of objects via network. It's
Codable
converted toData
and set intoURLRequest
. ButpostBodyArguments
getter tries to cast it to[String: Any]
, thus I'm gettingnil
when accessing it.URLRequest
's extension containinghttpBodyStreamData()
is private and thus I can't getData
by myself and convert it to[[String: Any]]
.As a workaround I've copypasted your
URLRequest
's extension into my tests and modified it to cast to[[String: Any]]
. It's working properly but leads to code duplication.Generics would have solved this problem