curl / Mailing Lists / curl-users / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

Transmitting csrf-token in the body

From: jetrca via curl-users <curl-users_at_cool.haxx.se>
Date: Sun, 31 Jan 2021 13:44:15 +0100
Dear ∀,
 
I am trying to import an XML-dump into a mediawiki installation.
 
I am logged in and can edit pages via action=edit.
 
My command so far, except for the token, is
 
curl --cookie tmp/COOKIE_JAR \
     --cookie-jar tmp/COOKIE_JAR \
     -H "Content-Type: multipart/form-data" \
     -F "=xml=<tmp/import.xml" \
     ${WIKI}/api.php?action=import\&format=json
 
Let the token be $csrf.
 
If I attach \&token=$csrf, the server will demand the token to be part of the body.
 -F "token=$csrf" returns the notoken-error, as does
-H "Token:$csrf" or
 -b "token=$csrf"
 
Can you please tell me how to transmit the token?
Thank you in advance!
Jetrca
 
 

-----------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-users
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2021-01-31