Thanks-I was reading the unibasic commands reference, but I'll give extensions a read as well.
Jeff Butera -- A tree falls the way it leans. Be careful which way you lean. The Lorax On Feb 9, 2013, at 8:16 PM, Kevin King <[email protected]> wrote: > This is somewhat described in "Submitting a Request" on page 62 of the > Unidata 7.1 UniBASIC Extensions manual, where it states: > > *For a POST request with non-empty post_data, the data is attached to the > request message as is. No encoding is performed, and any parameters added > through addRequestParameter() will be totally ignored. Otherwise the > following processing will be performed:* > * > * > *For a POST request with default content type, the parameter string is > assembled, a Content-Length header created, and then the string is attached > as the last part of the request message.* > * > * > *For a POST request with multipart/* content type, a unique boundary string > is created and then multiple parts are generated in the sequence they were > added through calling addRequestParameter(). Each will have a unique > boundary, followed by optional Content-* headers, and data part. The total > length is calculated and a Content-Length header is added to the message > header.* > > Bottom line, use addRequestParameter to add your fields to the POST data > and send this parameter into submitRequest as an empty string. Otherwise, > if you want to send in something like an XML document that has no > particular name associated with the value, put that value here and it will > be sent exactly as you put it in there without encoding of any kind (or so > the manual suggests). > > -K > > On Sat, Feb 9, 2013 at 4:36 PM, Jeffrey Butera <[email protected]>wrote: > >> I'm trying my hand at some http interation from within Unidata. I'm >> unclear about the proper way to POST data as the manual is vague. In short, >> I'm trying to POST two variables "foo" and "bar" to a given url: >> >> X.URL = 'http://some.url.com/script.**cgi <http://some.url.com/script.cgi> >> ' >> X.METHOD='POST' >> X.HANDLE = '' >> X.RESULT = createRequest(X.URL,X.METHOD,**X.HANDLE) >> >> X.TIMEOUT=2000 >> X.POST.DATA = ?? >> X.RESULT = submitRequest(X.HANDLE,X.**TIMEOUT,X.POST.DATA,X.** >> RESPONSE.HEADERS,X.RESPONSE.**DATA,X.HTTP.STATUS) >> >> I'm not clear how to properly format the post data - the documentation >> says it ignores previously set addRequestParameters. I'm guessing >> X.POST.DATA should be something like: >> >> X.POST.DATA = 'foo':@VM:'foo value':@FM:'bar':@VM:'bar value' >> >> But that's a complete guess. >> >> Thanks, >> Jeff (thawing from loads of snow) >> >> >> -- >> Jeffrey Butera, PhD >> Associate Director for Application and Web Services >> Information Technology >> Hampshire College >> 413-559-5556 >> >> ______________________________**_________________ >> U2-Users mailing list >> [email protected] >> http://listserver.u2ug.org/**mailman/listinfo/u2-users<http://listserver.u2ug.org/mailman/listinfo/u2-users> > _______________________________________________ > U2-Users mailing list > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
