Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Rexx/Curl - HTTPPOSTDATA Usage

Help
Brew
2005-11-08
2013-04-25
  • Brew
    Brew
    2005-11-08

    With the following command "call curlsetopt(curl, 'HTTPPOSTDATA', 'data.'" I keep receiving a "cURL error: 5 - INCOMPLETE"

    Does anyone have an example of how to use this command properly?

    Thanks

     
    • Mike Protts
      Mike Protts
      2005-11-09

      This may help.  This example uses a form containing 2 fields (upfile and note) and the target page should be in variable url.:

            call CurlVariable 'DEBUG',255
            Call CurlSetOpt curl, 'VERBOSE', '1'

            Call CurlSetopt curl, 'URL', url
           
            Call CurlSetOpt curl, 'HTTPPOST', '1'
            field.0 = 2
            field.1 = 'upfile=boot.ini'
            field.2 = 'note=curl'
            Call CurlSetOpt curl, 'HTTPPOSTFIELDS', 'FIELD.'

            Call CurlPerform curl

      If you are looking for file upload, I've been working with Mark on an enhancment - I can post details.

      Cheers
      Mike

       
    • Brew
      Brew
      2005-11-09

      Thanks a lot Mike:

      I'm afraid I already tried that, though it works fine I'm trying to send a raw datastream rather than fields.

      However I've gotten it to work sort of with the following:
              call curlformadd curl, 'FILE', 'Incident', 'text/xml', xmlFile
              call curlsetopt curl, 'HTTPPOSTFORM', 1
              call curlsetopt curl, 'URL', site
              call curlperform curl
              call curlformfree curl

      Seems to work fine.

      Thanks for your help.

      Later.

       
    • Mike Protts
      Mike Protts
      2005-11-09

      It seems that Mark has put the new form handling in already ;-).

      Cheers
      Mike

       
    • Brew
      Brew
      2005-11-09

      Hey:

      Unfortunately I just found out that a mult-part form is not acceptable to the user.

      I'm sure that the HTTPPOSTDATA function is the one I need .

      Any word on why I get an INCOMPLETE with <call curlsetopt curl, 'HTTPPOSTDATA', 'data.'>

      Thanks.

       
    • Brew
      Brew
      2005-11-09

      What I'm really looking for is a way to post data without a form. Just posting the raw data stream.

      Is this possible?