POSTing troubles [SOLVED]

Andrew2
Andrew2 New Altair Community Member
edited November 5 in Community Q&A
Hello all

I'm having trouble getting http POSTing to work with RapidAnalytics

I confidently used the curl -T example in the video tutorial with no trouble. I then found that an html form with POSTing failed no matter what I did.

I read the documentation to determine that curl sneakily turns what looks like a POST into a PUT. If I use the -X option with curl, I can't get it to work.

I broke out the big guns to observe protocol traffic

This is the working curl -T command - note the sneaky PUT
PUT /RA/public_process/post? HTTP/1.1
User-Agent: curl/7.20.1 (i686-pc-cygwin) libcurl/7.20.1 OpenSSL/0.9.8r zlib/1.2.5 libidn/1.18 libssh2/1.2.5
Host: 192.168.0.15:8080
Accept: */*
Content-Length: 72974
Expect: 100-continue
Whereas this is the non-working curl -X (the html form example is similar)
POST /RA/public_process/post? HTTP/1.1
User-Agent: curl/7.20.1 (i686-pc-cygwin) libcurl/7.20.1 OpenSSL/0.9.8r zlib/1.2.5 libidn/1.18 libssh2/1.2.5
Host: 192.168.0.15:8080
Accept: */*
Content-Length: 26983
Content-Type: application/x-www-form-urlencoded
Expect: 100-continue
Before I spend hours Googling, is there something I could do to make this work with POST?

hopefully...

Andrew
Tagged:

Answers

  • Andrew2
    Andrew2 New Altair Community Member
    Made some progress

    In the PUT case, the file that turns up in RA is a valid zip file. In the POST case, the file has various headers before the data, things like "content-disposition". RM on the RA machine is expecting a zip file but it isn't quite this.

    Andrew
  • Andrew2
    Andrew2 New Altair Community Member
    Cracked it

    POSTing an html form causes extra name-value pairs to be inserted in the http request that cause confusion on the RA server. POSTing or PUTting using a more direct approach gets round it. Now I can create simple static Web pages that are able to take zip files from a user, upload to the RA server for processing with RM.


    Andrew