Skip to content

Instantly share code, notes, and snippets.

@devasat
Created May 21, 2017 01:23
Show Gist options
  • Save devasat/777397934f565df6264016098049f3fc to your computer and use it in GitHub Desktop.
Save devasat/777397934f565df6264016098049f3fc to your computer and use it in GitHub Desktop.
Call login protected (Java) services using curl
# JSESSIONID is used by the server to identify if the user is logged in. Manually login via the browser in the application,
# use Chrome developer tool or Firebug to get JSESSIONID and use that in the curl command to invoke the service endpoints.
curl --cookie "JSESSIONID=REPLACE_THIS" http://localhost.xom/api/resourcename/id
#Example:
for i in `seq 1 100` ; do
curl --cookie "JSESSIONID=12345678901234567890" http://localhost.xom/api/resourcename/${i}/; echo "";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment