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
Check out [Android Async HTTP Docs](http://loopj.com/android-async-http/) for more request creation details.
191
+
Check out [Android Async HTTP Docs](https://github.com/codepath/asynchttpclient) for more request creation details.
192
192
193
193
## Extra Functionality
194
194
195
-
### Adding Request Headers
196
-
197
-
In certain cases, requests will require a particular custom header to be passed through the client. In this case, you can add custom headers to the client that will be added to all requests with:
In order to [troubleshoot API calls](http://guides.codepath.com/android/Troubleshooting-API-calls) using a method such as Charles Proxy, you'll want to enable proxy support with:
227
+
In order to [troubleshoot API calls](http://guides.codepath.com/android/Troubleshooting-API-calls), you can take advantage of the Stetho library:
239
228
229
+
Next, initialize Stetho inside your Application object:
Proxies are useful for monitoring the network traffic but require a custom SSL certificate to be added to your emulator or device. Because Android API 24 and above now require [explicit control](https://developer.android.com/training/articles/security-config.html) on custom SSL certificates that are used in apps, you will need to allow for added certs to be added by specifying `res/xml/network_security_config.xml` in your app:
246
-
239
+
Edit the manifest.xml file in your project. To let the Android operating system know that you have a custom Application class, add an attribute called `android:name` to the manifest’s application tag and set the value to the name of your custom Application class.
247
240
```xml
248
-
<?xml version="1.0" encoding="utf-8"?>
249
-
<network-security-config>
250
-
<debug-overrides>
251
-
<trust-anchors>
252
-
<!-- Trust user added CAs while debuggable only -->
253
-
<certificatessrc="user" />
254
-
</trust-anchors>
255
-
</debug-overrides>
256
-
</network-security-config>
241
+
<application
242
+
...
243
+
android:name=".MyApplication"
244
+
...
245
+
>
257
246
```
258
247
259
-
Inside your AndroidManifest.xml file, make sure to include this `networkSecurityConfig` parameter:
You can then use `chrome://inspect`, pick the app currently running, and click on the Network tab to view. See [this guide](https://github.com/codepath/android_guides/wiki/Debugging-with-Stetho) for more context.
0 commit comments