[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Simple http_url_post example please



Hi Jakob,

In order to help you, I think we need to understand what's lacking in the existing examples? After all, if I were to write a new one, it'd probably look pretty much like those old ones.

Also, FWIW, the two examples you gave do completely different things. The first one ("normal world") passes HTML form data as part of the URL, and then sends 0 bytes of POST data. The receiving application would need to know to look for the data in the QUERY_STRING, since it won't be found in the POST data. For an instance like this, it would be far more intuitive to use GET instead of POST, since you're not sending any POST data.

The second example ("curl") sends the data in the POST data rather than the URL.

An application that can handle both of your examples would need to be carefully coded, since it would have to check two input sources for the data. (But... I have, indeed, seen many web apps that do exactly that.)

At any rate, I don't understand where you're struggling with the examples. Maybe the *CMD interface would be easier for you?

-SK



On 9/14/2012 2:46 AM, Jakob Zander wrote:
    Hi,
    First of all, I am no RPG programmer, but I need to implement a simple
    REST consuming services in ILE RPG.
    I've looked through the given examples and tried to alter some to my
    needs but without luck.
    How do I solve this in a simple minimal way?
    In the "normal world" I would just POST to an url, like this.
    test.domain.com/users/?username=NewUser&email=NewUser@xxxxxxxx
    Or with curl:
    curl -v -X POST -d 'username=NewUser&email=NewUser@xxxxxxxx'
    test.domain.com/users
    How is this done with HTTPAPI? How to I use http_url_post? A full
    example would be great!
    Best regards,
    Jakob


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------