I am trying to add a document to a Confluence page. I am using this code:
E:\APP\"curl-7.53.1"\src\curl.exe -v -S -u user:password -X POST -H "X-Atlassian-Token: no-check" -F "file=@C:\Users\srvc_mdw_dev\Desktop\conf.txt" -F "comment=this is my file" "http://confluence.example.net/rest/api/content/36375143/child/attachment"
But I get the following error:
./confNote: Unnecessary use of -X or --request, POST is already inferred.
* timeout on name lookup is not supported* Trying IPaddress...
* TCP_NODELAY set
* Connected to confluence.example.net (ip address) port 80 (#0)
* Server auth using Basic with user 'user'
> POST /rest/api/content/36375143/child/attachment HTTP/1.1
> Host: example.com> Authorization: Basic c291aGFpbC5vdWFiaUBtZXRyb2V4dGVybmFsLmZyOm1ldHJvNDU2Kg==
> User-Agent: curl/7.53.1
> Accept: */*
> X-Atlassian-Token: no-check> Content-Length: 333
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------646f724e33da0066
>
* HTTP 1.0, assume close after body< HTTP/1.0 302 Found
< Location: https://example.net/rest/api/content/36375143/child/attachment< Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
< Content-Length: 0
* HTTP error before end of send, stop sending<
* Closing connection 0
******** EDIT ******** Once I add the - L i still get the same error and the following return too :
PS E:\powershell\script> ./conf
* timeout on name lookup is not supported
* Trying IP address...
* TCP_NODELAY set
* Connected to confluence.exemple.net (IP address) port 80 (#0)
> POST /rest/api/content/pageId/child/attachment HTTP/1.1
> Host: confluence.exemple.net
> User-Agent: curl/7.53.1
> Accept: */*
> X-Atlassian-Token: nocheck
> Content-Length: 633874
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------9448fd34591626bc
>
* HTTP 1.0, assume close after body
< HTTP/1.0 302 Found
< Location: https://confluence.exemple.net/rest/api/content/pageId/child/attachment
< Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
< Content-Length: 0
* HTTP error before end of send, stop sending
<
* Closing connection 0
* Issue another request to this URL: 'https://confluence.exemple.net/rest/api/content/pageID/child/attachment'
* Switch from POST to GET
* timeout on name lookup is not supported
* Trying IPaddress...
* TCP_NODELAY set
* Connected to confluence.exemple.net (IPaddress) port 443 (#1)
* schannel: SSL/TLS connection with confluence.exemple.net port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 200 bytes...
* schannel: sent initial handshake data: sent 200 bytes
* schannel: SSL/TLS connection with confluence.exemple.net port 443 (step 2/3)
* schannel: encrypted data buffer: offset 4096 length 4096
* schannel: encrypted data length: 4004
* schannel: encrypted data buffer: offset 4004 length 4096
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with confluence.exemple.net port 443 (step 2/3)
* schannel: encrypted data buffer: offset 4865 length 5028
* schannel: next InitializeSecurityContext failed: Unknown error (0x80092013) - The revocation function was unable to ch
eck revocation because the revocation server was offline.
* Closing connection 1
* schannel: shutting down SSL/TLS connection with confluence.exemple.net port 443
* Send failure: Connection was reset
* schannel: failed to send close msg: Failed sending data to the peer (bytes written: -1)
* schannel: clear security context handle
User contributions licensed under CC BY-SA 3.0