It's better when it's simple

User Tools

Site Tools


Translations of this page?:

Learn about DokuWiki

Advanced Use

Corporate Use

Our Community

Follow us on Facebook, Twitter and other social networks.

Our Privacy Policy


Logging in with cURL

Sometimes you might want to monitor or grab pages directly from scripts. It is easy, unless your DokuWiki installation requires logging in. In that case you can use cookie and POST variable support in curl.

Step 1 - log in and store cookie.

curl -d "u=<username>&p=<password>" --cookie-jar cjar

This stores login cookie in a file named cjar in the current directory. Now we can retrieve pages that require us to be logged in.

Step 2 - retrieve pages.

Now we can easily retrieve protected pages, but we still have to indicate to DokuWiki that we are the same person who logged in previously.

curl --cookie cjar --cookie-jar cjar

This reuses cookie from the cjar file and allows us to retrieve those pages.

See also

tips/curl_login.txt · Last modified: 2019-06-07 09:10 by Michaelsy