I need to parse images from 500px and show it in my android application. But all trys get me an error: "json parse error unrecognized token '<'". How can i fetch just src for images?
I don't know much about this, serfing internet don't help at all, try a bunch of combinations using fetch function.
webCall=()=>{
return fetch('https://500px.com/popular')
.then((response) => response.json())
.then((responseJson) => {
this.setState({
isLoading: false,
dataSource: responseJson
}, function() {
// In this block you can do something with new state.
});
})
.catch((error) => {
console.error(error);
});
}
https://500px.com/popular returns an HTML page, not an image. The unrecognized token '<'
refers to the first character of the opening tag received from the page (likely <!DOCTYPE>
. Parsing HTML as JSON doesn't work.
It looks like 500px closed their public API recently, so you might be out of luck.
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加