curl-library
Re: Is it possible to simply write to a socket?
Date: Thu, 12 Jul 2012 22:01:01 -0700
Guenter,
On Thu, Jul 12, 2012 at 7:41 PM, Guenter <lists_at_gknw.net> wrote:
> Hi Igor,
> Am 13.07.2012 01:49, schrieb Igor Korot:
>
>> I'm transferring the code from VB to C/C++ to make it cross-platform.
>> In VB, there is following code:
>>
>> [code]
>> Dim boundary As String = "---------------------------"&
>> DateTime.Now.Ticks.ToString("x")
>> Dim newLine As String = System.Environment.NewLine
>> Dim boundaryBytes As Byte() =
>> System.Text.Encoding.ASCII.GetBytes(newLine& "--"& boundary&
>> newLine)
>> Dim request As Net.HttpWebRequest = Net.WebRequest.Create(uri)
>>
>> request.ContentType = "multipart/form-data; boundary="& boundary
>> request.Method = "POST"
>> request.KeepAlive = True
>> request.Credentials = Net.CredentialCache.DefaultCredentials
>>
>> Using requestStream As IO.Stream = request.GetRequestStream()
>> requestStream.Write(boundaryBytes, 0, boundaryBytes.Length)
>> End Using
>> [/code]
>>
>> AFAIU, it just simply writes boundary bytes to the socket as an ASCII
>> bytes sequence.
>> There is post-ing involved, no form submittal
>> Is it possible to do the same with libcurl?
>
> although this might be possible with libcurl - if I were you I would use
> Perl for this task; you have then a simple script which runs on almost every
> platform, no hassle with IDEs, compilers and MS dotnet redistributables
> install which you most likely need if you compile with MSVC 2010, and
> finally easy to write with your favourite text editor ...
If it was that easy... ;-)
The program has GUI and it should be cross-platform, therefore I chose
wxWidgets/C++.
And I need the file to be transferred in addition to this simple
string for processing
and get the result of this processing back.
Thank you.
>
> libcurl is more meant for high-level tasks which you dont want ...
>
> Gün.
>
>
>
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/list/listinfo/curl-library
> Etiquette: http://curl.haxx.se/mail/etiquette.html
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-07-13