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

Re: [Ftpapi] I need to pass my post data as json...



Scott,

I think that the problems Gerald had are somewhat normal when starting
with new stuff. For me nothing was intuitive when I started with HTTPAPI
and web services (later on). That also happened, when I started with
XML, Java and actually every new stuff. Currently I have to wrestle with
Dynamics AX.

People starting with WSDL2RPG often ask things where I think "Why do
he/she asks that. It should be clear." But then I remember my first
steps and I gladly answer the question.

It is the "feeling" for the new topic that is missing and that has to grow.

But what always helped was looking at examples and from my point of view
the examples shipped with HTTPAPI cover lots of aspects. Eventually the
remaining problems can be solved with the help of the mailing list.

Last but not least it was great if people would add examples or little
PDF tutorials for those things that were not clear for them. That would
ease the life of the next developer starting from scratch. Of course I
know that creating a new example is not always possible, because there
is not public http service they could use for it.

Just my two cents,

Thomas.

Am 24.02.2017 um 23:25 schrieb Scott Klement:
> Gerald,
> 
> Glad to see that you figured out the answer, here.  I guess I'm
> wondering what I should be doing to make this more intuitive?
> 
> My way of thinking was that the WEBFORM_xxx routines would be for
> encoding one particular document type -- that of a URL-encoded web
> form.  i.e. data that looks like this:
> 
> myvar=value&var2=value&var3=data%20with%20spaces
> 
> It would never have occurred to me to try to use these routines to make
> JSON data, which of course, looks more like this:
> 
> { "myvar": "value", "var2": "value", "var3": "data with spaces" }
> 
> Similarly, I would not have expected to use it for XML... or anything
> else... you get the idea... just web forms.
> 
> So, I'm wondering what I can do in HTTPAPI to make this more clear and
> intuitive?
> 
> -SK
> 
> 
> On 2/24/2017 12:36 PM, Gerald Magnuson wrote:
>>
>> I got it figured out
>>
>> (after I was pointed to the archive) J
>>
>> Rqst_body = '{"typeId":"6"}';
>>
>> dataSize = 14;
>>
>> http_xproc( HTTP_POINT_ADDL_HEADER
>>
>>             : %paddr(add_headers) );
>>
>> rc=http_url_post_raw(
>>
>> 'https://XXX.YYYYzYYY.zzz' +
>>
>> '/app/search':
>>
>> %addr(Rqst_body): dataSize:
>>
>> 1: %paddr('INCOMING')
>>
>> :HTTP_TIMEOUT
>>
>> :HTTP_USERAGENT
>>
>> : 'application/json' );
>>
>> *Gerald Magnuson | *Senior System I Admin
>>
>>     
>>
>>
>> The Knapheide Manufacturing Company
>> 1848 Westphalia Strasse//P.O. Box 7140//Quincy, IL//62305-7140
>> P: 217-592-5291//F: 217-592-5046//www.knapheide.com
>>
>>     
>>
>> <http://bit.ly/Knapheide-Facebook><http://bit.ly/Knapheide-LinkedIn><http://bit.ly/Knapheide-Instagram><http://bit.ly/Knapheide-Twitter><http://bit.ly/Knapheide-YouTube>
>>
>>
>>     
>>
>> *From:* Gerald Magnuson
>> *Sent:* Friday, February 24, 2017 11:48 AM
>> *To:* HTTPAPI and FTPAPI Projects (ftpapi@xxxxxxxxxxxxxxxxxxxxxx)
>> <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
>> *Subject:* I need to pass my post data as json...
>>
>> I need to figure out how to write json directly to the request body….
>>
>> With the following code:
>>
>> Form = WEBFORM_open;
>>
>>      WEBFORM_SetVar(Form: 'typeId': '6' );
>>
>>     WEBFORM_postData( Form : myPointer
>>
>>        : dataSize );
>>
>> I wind up with:           typeID=6
>>
>> In my request body….
>>
>> But I need to have:
>>
>> {“typeId”:6}
>>
>> Is there some way to use WEBFORM to pass json?
>>
>> *Gerald Magnuson | *Senior System I Admin
>>
>>     
>>
>>
>> The Knapheide Manufacturing Company
>> 1848 Westphalia Strasse//P.O. Box 7140//Quincy, IL//62305-7140
>> P: 217-592-5291//F: 217-592-5046//www.knapheide.com
>>
>>     
>>
>> <http://bit.ly/Knapheide-Facebook><http://bit.ly/Knapheide-LinkedIn><http://bit.ly/Knapheide-Instagram><http://bit.ly/Knapheide-Twitter><http://bit.ly/Knapheide-YouTube>
>>
>>
>>     
>>
>>
>>
>> _______________________________________________
>> Ftpapi mailing list
>> Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
>> http://scottklement.com/mailman/listinfo/ftpapi
> 
> _______________________________________________
> Ftpapi mailing list
> Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
> http://scottklement.com/mailman/listinfo/ftpapi
> 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi