请大家我发现传递标头值来响应本机pdf视图(https://https://github.com/rumax/react-native-PDFView)。我已经尝试过这样做const resources = {
resource: 'fjfjfjhfjjfj.com',
resourceType: 'url',
urlProps: {
method: 'GET',
headers: {
'Accept-Language': 'en-us,en;q=0.5',
'Accept-encoding': 'application/pdf',
'Referer': 'http://localhost/youdeymad',
},
}
};
`<PDFView
style={{ flex: 1 }}
onError={error => {
Alert.alert(
'Error',
'An error occured fetching invoice, Please try again later'
);
props.stopLoading(false);
}}
onLoad={() => props.stopLoading(false)}
// resource={`${SERVER_URL}/mobilesales/showreceipt/${props.saleId}`}
// resourceType="url"
// Run "node demo/utils/server.js" to start the local server. Put correct IP
resource={resources.resource}
resourceType={resourceType}
urlProps={resources.urlProps}
/>`