O requestInfo:
const requestInfo = {
method : 'POST',
body : JSON.stringify({ texto : this.comentario.value }),
// Headers faz parte da Fetch API
headers : new Headers({
'Content-type' : 'application/json'
})
}
O endpoint:
http://localhost:8080/api/fotos/${this.props.foto.id}/comment/X-AUTH-TOKEN=${localStorage.getItem('auth-token')}
A resposta:
Response {type: "cors", url: "http://localhost:8080/api/fotos/3/comment/X-AUTH-T…Ih9Be-832MQBrJ5DxHwJzyQ-P-wp9lP49fSCmr_St-kl97nPw", redirected: false, status: 403, ok: false, …}
body:ReadableStream
bodyUsed:false
headers:Headers {}
ok:false
redirected:false
status:403
statusText:""
type:"cors"
url:"http://localhost:8080/api/fotos/3/comment/X-AUTH-TOKEN=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhbG90cyJ9.AQrl-JRJg39KeKYxMfNpnljXwxu0WOa8iYxT1Ih9Be-832MQBrJ5DxHwJzyQ-P-wp9lP49fSCmr_St-kl97nPw"
__proto__:Response
Alguma ideia?
Obrigado.