[Mono-list] Linux command line curl to C#

Agustin Gimenez geniwab at gmail.com
Wed Oct 8 12:10:27 UTC 2014


Also, you can use a WebClient:

var wc = new WebClient();
wc.UploadFile(UrlToPost, PathToFile);

With your example data UrlToPost will be "https://server.com" and if the
file is in the same dir as the application PathToFile will be
"WellFormed.xml", else it must be an absolute path.

Cheers.

2014-10-08 13:17 GMT+02:00 Edward Ned Harvey (mono) <
edward.harvey.mono at clevertrove.com>:

> > From: mono-list-bounces at lists.ximian.com [mailto:mono-list-
> > bounces at lists.ximian.com] On Behalf Of Alf Stockton
> >
> > curl -X POST https://server.com -Hcontent-type:application/xml -d
> > @WellFormed.xml
>
> Oh, um -
>
> You might need to escape some characters, for example:
> "C:\\Users\\eharvey\\myprogram.exe blah blah"
>
> Or mark it as a string literal:
> @"C:\Users\eharvey\myprogram.exe blah blah"
> _______________________________________________
> Mono-list maillist  -  Mono-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20141008/df00a382/attachment.html>


More information about the Mono-list mailing list