我正在尝试从此JSON URL API访问所有的“ landscapePosterId”。在上述网址的JSON响应中:
“ landscapePosterId”是图像ID。我想在下面的URL中传递它以获取像
http://staging.connectingdotsinfotech.com:8080/firestixAPI_dev_2/api/v1/files/download/
例:-
http://staging.connectingdotsinfotech.com:8080/firestixAPI_dev_2/api/v1/files/download/5de660b91b5f7b5d95559311,所以我如何合并这两个API并访问图像
这是我的代码o访问“ landscapePosterId”
import React from 'react';
import Axios from 'axios';
import "react-responsive-carousel/lib/styles/carousel.min.css"; // requires a loader
import { Carousel } from 'react-responsive-carousel';
class Slider extends React.Component {
constructor() {
super();
this.state = {
data: []
}
}
async componentDidMount() {
const response = await Axios.get("http://staging.connectingdotsinfotech.com:8080/firestixAPI_dev_2/api/v2/media/fetchAllMediaSlider")
.then((response) => {
//console.log(response.data)
this.setState({
data: response.data
})
})
}
async componentDidMount() {
const response = await Axios.post("")
}
render() {
return (
<>
<Carousel>
<div>
{
this.state.data.map((item,index) => {
return (
<div key={index}>
{item.landscapePosterId}
</div>
)
})
}
</div>
</Carousel>
</>
)
}
}
export default Slider;