Hi,

I have a parameterized build which takes a file parameter. Its goal is to 
simply upload a file to the jenkins server.

I need to trigger this job, and upload the file, via C# code.  I've tried 
different methods, but I either get an 500 Internal Server error or a 403 
Forbidden error, although my credentials are correct.

On the remote access API page all they give is this curl command :

curl -X POST JENKINS_URL/job/JOB_NAME/build \
  --user USER:PASSWORD \
  --form file0=@PATH_TO_FILE \
  --form json='{"parameter": [{"name":"FILE_LOCATION_AS_SET_IN_JENKINS", 
"file":"file0"}]}'


>From what I understand, I need to make a POST request as a 
>"multipart/form-data" content type and put the contents of the file in the 
>request body.


Does anyone know how to trigger this kind of job from a C# program ?


Thank you,


Oli

-- 
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/fc541711-8322-446d-990b-f0d902263848%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to