Added documentation for additional fields of Image

Summary:
Hi there,

As ospfranco found there is some documentation for the code coming from #7338 missing, so I added it. It concerns the method, headers and bdoy field on the Image source object.

If you would like to have any changes made, please don't hesitate to comment, I will add them.

Have a nice day and thank you for maintaining React Native!
Closes https://github.com/facebook/react-native/pull/9304

Differential Revision: D4913262

Pulled By: javache

fbshipit-source-id: 922430ec3388560686e1cf53cb5dff7f30e4e31f
This commit is contained in:
Daniel Schmidt 2017-04-19 04:59:05 -07:00 committed by Facebook Github Bot
parent a9ad81a085
commit 625df661d5

View File

@ -95,6 +95,22 @@ Many of the images you will display in your app will not be available at compile
<Image source={{uri: 'https://facebook.github.io/react/img/logo_og.png'}} />
```
### Network Requests for Images
If you would like to set such things as the HTTP-Verb, Headers or a Body along with the image request, you may do this by defining these properties on the source object:
```javascript
<Image source={{
uri: 'https://facebook.github.io/react/img/logo_og.png',
method: 'POST',
headers: {
Pragma: 'no-cache'
},
body: 'Your Body goes here'
}}
style={{width: 400, height: 400}} />
```
### Cache Control (iOS Only)
In some cases you might only want to display an image if it is already in the local cache, i.e. a low resolution placeholder until a higher resolution is available. In other cases you do not care if the image is outdated and are willing to display an outdated image to save bandwidth. The `cache` source property gives you control over how the network layer interacts with the cache.