Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Home
Help
Search
Login
Register
Chilkat Forum
»
Technologies
»
REST / HTTP / HTTPS
»
Curl -F parameter
« previous
next »
Print
Pages: [
1
]
Author
Topic: Curl -F parameter (Read 3960 times)
Mafact
Newbie
Posts: 2
Karma: +0/-0
Curl -F parameter
«
on:
February 06, 2018, 04:40:53 AM »
Hi,
I'm trying to upload a file but without success...
the Curl command wich is working is
curl \
-H "X-Software-Company: 08d09a20-1a94-4284-9305-375d46a02914" \
-F "file=@file.xml" \
-u <login:password> "
https://sandbox-api.codabox.com/v2/peppol/licences/95c359ec-7cee-4eaa-b9ba-a6e07db22f31/upload/
"
So I can connect using
oHttp.SetRequestHeader "Content-Type", "multipart/form-data"
oHttp.Login = cLogin
oHttp.Password = cPasswd
oReq.ContentType = "multipart/form-data"
oReq.AddHeader "X-Software-Company", "08d09a20-1a94-4284-9305-375d46a02914"
oReq.AddHeader "Content-Type", "multipart/form-data"
oReq.HttpVerb = "POST"
This one seem to not work ( -d param in CURL, not -F )
oReq.AddParam ("file","file=@file.xml")
oResp = oHttp.PostUrlEncoded("
https://sandbox-api.codabox.com/v2/peppol/licences/95c359ec-7cee-4eaa-b9ba-a6e07db22f31/upload/
",oReq)
success = oHttp.LastMethodSuccess return 1 ok
The file is never sended !
Any Idea ?
Logged
Chilkat
Administrator
Full Member
Posts: 103
Karma: +7/-0
Re: Curl -F parameter
«
Reply #1 on:
February 06, 2018, 07:01:02 AM »
Use the online tool to generate code from a CURL command:
http://tools.chilkat.io/curl.cshtml
Logged
Mafact
Newbie
Posts: 2
Karma: +0/-0
Re: Curl -F parameter
«
Reply #2 on:
February 06, 2018, 09:39:12 AM »
Thanks,
Will do
Logged
Print
Pages: [
1
]
« previous
next »
Chilkat Forum
»
Technologies
»
REST / HTTP / HTTPS
»
Curl -F parameter