nsurl - Access Request Data NSUrlProtocol with SessionClient -
i'm having problem intercepting sessionclient post requests using afmotion sessionclient. weirdly, code works fine when using generic afmotion::http.post action
class protocol < nsurlprotocol def self.caninitwithrequest(request) homecoming true end def initwithrequest(request, cachedresponse:response, client: client) puts request.httpbody end end nsurlprotocol.registerclass(protocol) # works fine intercepting info afmotion::http.post("http://espn.com", {:msg => "i sports"}) # above output msg="i sports expected" end # doesn't work expected c = afmotion::sessionclient.build "http://www.espn.com" c.post("/", {:msg => "i sports"} # initwithrequest request object has nil both httpbodystream , httpbody methods end here's i'm working on. request parameter sent initwithrequest doesn't seem have access post data, when using sessionclient, does, work fine , have access expected parameters when using generic afmotion::http.post
nsurl nsurlrequest afnetworking-2 rubymotion nsurlsession
No comments:
Post a Comment