ARSubmitPost

From Blue Mars Developer Guidebook

Jump to: navigation, search
There are security restrictions on this article

This is an Avatar Reality Utilities function.

Contents

Function

ARSubmitPost(url, destfile, parameters, options)
send an HTTP POST request
url - string web URL of the request
destfile - string file in which to save results of the HTTP request
parameters - table table of key-value parameters to include with the request
options - table table of additional options accepted by ARDownloadFile

Notes

destfile is in the Blue Mars user directory, i.e. it is passed to ARUserPath

Code

This convenience function for HTTP GET requests allows you to supply the request parameters as a table of key-value pairs. It calls ARDownloadParamString to urlencode and concatenate the parameters and then includes them in the post parameter of the options table passed to ARDownloadFile (which in turn includes them in the body of the HTTP request)

function ARSubmitPost(url, dest, params, options)
   if not options then
      options = {};
   end
   options.post=ARDownloadParamString(params);
   ARDownloadFile(url,dest,options);
end

Examples

Notes

Problems with this wiki page? Contact us either by: Support Email or Support Ticket System

Blue Mars Guidebook Privacy Policy
Blue Mars Guidebook Community Guidelines

Personal tools