I am working on a springMVC project in which the user authentication is based on spring security.
the idea is to have a mobile (android) application to be able to se
It's not enough for me to use just -d options. Our web application is hosted by Tomcat, located in webapps/ROOT folder and have the following configuration:
The following works to send POST request to our web application (assuming Tomcat is listening on port 8080):
curl -i -H "Content-Type: application/x-www-form-urlencoded" -c cookies.txt -H "Origin: http://localhost:8080/" -d "j_username=USERNAME&j_password=PASSWORD" -X POST http://localhost:8080/j_spring_security_check
curl -i -d @JSON_FILE -H "Content-Type: application/json" -H "Origin: http://localhost:8080/" -b cookies.txt -X POST http://localhost:8080/URL
Replace USERNAME, PASSWORD, JSON_FILE and URL with your own.