- Latest Forum Post
- Caused by: java.lang.UnsupportedClassVersionError: org/springframework/boot/maven/RunMojo (Spring)
- PHP Fatal error: Cannot pass parameter 2 by reference (PHP)
- How to use TypeAhead in Reactjs 18 (JavaScript)
- Windows 7 Node.js Install Higher Version (above 13) (MS Windows)
- Column name pattern can not be NULL or empty (Spring)
I have worked on code which i have given link above. it has worked for me when i run it independently.
but when i apply this same code in my project [ angular4 with spring boot micro services] it was giving error related to X-XSRF TOKEN as follows,
[{“timestamp”:1528350053314,”status”:403,”error”:”Forbidden”,”message”:”Invalid CSRF Token ‘null’ was found on the request parameter ‘_csrf’ or header ‘X-XSRF-TOKEN’.”,”path”:”/core-location/post”}] .
Here i need to pass some headers like X-XSRF TOKEN so passed headers as follows,
formdata.append(‘file’, file);
formdata.append(‘Content-Type’, ‘application/json’);
formdata.append(‘Accept’,
application/json
);formdata.append(‘X-XSRF-TOKEN’, this._cookieService.get(“XSRF-TOKEN”));
const req = new HttpRequest(‘POST’,’http://localhost:8088/core-location/post’, formdata, {
reportProgress: true,
responseType: ‘text’
});
return this.http.request(req);
}
}
After passing headers also its giving me same error and also file is not going to backend[springboot]. How to pass headers in the request.
please provide solution for this.
Thanks and Regards
Shakti Lohar