You need to use the curl -F switch to make it a multipart http submission. This 
will allow a file and parameter to be included with a single http post 
submission. Plenty of online examples available.

Sent from my iPad

> On Aug 17, 2015, at 2:41 PM, Greg Nifor <[email protected]> wrote:
> 
> Is there a way to use curl to send both a file and string parameter. I can do 
> each individually, but not together.
> 
> Works:
> 
> curl -X POST <jenkins_url>/job/<job>/buildWithParameters -u <user>:<password> 
> -F file=@/path/to
> 
> curl -X POST <jenkins_url>/job/<job>/buildWithParameters -u <user>:<password> 
> --data string0=foo --data string1=bar
> 
> Doesn't Work:
> 
> curl -X POST <jenkins_url>/job/<job>/buildWithParameters -u <user>:<password> 
> -F file=@/path/to --data string0=foo --data string1=bar
> 
> The result I get is: Warning: You can only select one HTTP request!
> 
> 
> Any ideas?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Jenkins Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jenkinsci-users/65067202-61bf-40b8-8509-376d5ae79589%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/696374BB-4DF9-4343-B8B9-A4680391429B%40comcast.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to