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
Copy file name to clipboardExpand all lines: README.md
+77Lines changed: 77 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,6 +92,82 @@ github "ProxymanApp/atlantis"
92
92
93
93
For Carthage with Xcode 12, please check out the workaround: https://github.com/Carthage/Carthage/blob/master/Documentation/Xcode12Workaround.md
94
94
95
+
## Advanded Usage
96
+
By default, if your iOS app uses Apple's Networking classes (e.g URLSession or NSURLConnection) or using popular Networking libraries (e.g Alamofire and AFNetworking) to make an HTTP Request, Atlantis will work **OUT OF THE BOX**.
97
+
98
+
However, if your app doesn't use any one of them, Atlantis is not able to automatically capture the network traffic.
99
+
100
+
To resolve it, Atlantis offers certain functions to help you **manually*** add your Request and Response that will present on the Proxyman app as usual.
101
+
102
+
#### 1. My app uses C++ Network library and doesn't use URLSession, NSURLSession or any iOS Networking library
103
+
You can construct the Request and Response for Atlantis from the following func
104
+
```swift
105
+
/// Handy func to manually add Atlantis' Request & Response, then sending to Proxyman for inspecting
106
+
/// It's useful if your Request & Response are not URLRequest and URLResponse
107
+
/// - Parameters:
108
+
/// - request: Atlantis' request model
109
+
/// - response: Atlantis' response model
110
+
/// - responseBody: The body data of the response
111
+
publicclassfuncadd(request: Request,
112
+
response: Response,
113
+
responseBody: Data?) {
114
+
```
115
+
- Example:
116
+
```swift
117
+
@IBActionfuncgetManualBtnOnClick(_sender: Any) {
118
+
// Init Request and Response
119
+
let header =Header(key: "X-Data", value: "Atlantis")
120
+
let jsonType =Header(key: "Content-Type", value: "application/json")
121
+
let jsonObj: [String: Any] = ["country":"Singapore"]
122
+
let data =try! JSONSerialization.data(withJSONObject: jsonObj, options: [])
0 commit comments