You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Creates a new request handler using the given callback to call on request without parsing the body arguments and without passing the request.
48
+
/// - Parameter callback: The callback which will be executed just before the request executes.
49
+
publicinit(callback:@escaping()->Void){
50
+
self.internalCallback ={ _ in
51
+
callback()
52
+
}
53
+
legacyCallback =nil
54
+
}
55
+
56
+
/// Creates a new request handler using the given callback to call on request.
57
+
/// - Parameter jsonDictionaryCallback: The callback that executes just before the request executes, containing the HTTP Body Arguments as a JSON Object Dictionary.
let httpBody = request.httpBodyStreamData()?? request.httpBody,
62
+
let jsonObject =try?JSONSerialization.jsonObject(with: httpBody, options:.fragmentsAllowed)as?[String:Any]
63
+
else{
64
+
jsonDictionaryCallback(request,nil)
65
+
return
66
+
}
67
+
jsonDictionaryCallback(request, jsonObject)
68
+
}
69
+
self.legacyCallback =nil
70
+
}
71
+
72
+
/// Creates a new request handler using the given callback to call on request.
73
+
/// - Parameter jsonDictionaryCallback: The callback that executes just before the request executes, containing the HTTP Body Arguments as a JSON Object Array.
0 commit comments