vault-development / react-native-svg-uri

Render SVG images in React Native from an URL or static file
850 stars 334 forks source link

use POST instead of GET #138

Open EvanGeminika opened 5 years ago

EvanGeminika commented 5 years ago

Is it possible to user POST request, instead of GET request? It's because I want to send some personal or platform information to the server. So, server application can save that personal information and captcha character as a reference to validate the next request.

fniwes commented 5 years ago

I am not sure if it was intentional, but you can make post requests, passing a Request object at the Uri parameter, instead of a string.

For example, instead of <SvgUri source={{uri:'http://test.com/test.svg'}} />

You should be able to do something like

const request = new Request('http://test.com/test.svg', { method: 'POST' });
<SvgUri source={{uri: request}} />

You can get more details about creating a Request at https://developer.mozilla.org/en-US/docs/Web/API/Request/Request