URLExecute

URLExecute[url]
executes the specified URL, importing whatever result is generated.

URLExecute[url,{"param1"val1,"param2"val2,}]
executes the specified URL, adding elements with names parami and values vali.

URLExecute[url,params,format]
imports the result using the specified format.

URLExecute[obj,]
executes the cloud object obj.

URLExecute[HTTPRequest[],]
executes the specified HTTP request.

Details and OptionsDetails and Options

  • In URLExecute[url], url can be a string, a URL object, or a cloud object.
  • URLExecute[assoc] is equivalent to URLExecute[HTTPRequest[assoc]].
  • For simple forms of the vali such as numbers and short strings, URLExecute performs a GET request, with the parami specifying parameters in the query string. In other cases, it performs a POST request.
  • The vali can be strings or numbers, or the following special forms:
  • None,Null,Missing""
    True"true"
    False"false"
    {e1,e2,}e1, e2,
    imagean image in default format
    ExportForm[expr,form]any expression, exported in the specified form
    File["file"]the contents of a file
  • URLExecute takes the same options as URLRead.
  • URLExecute[url] and URLExecute[url,params] import the result from the URL, automatically determining the format to use. JSON is by default imported in "JSON" format.
  • In URLExecute[url,params,format], format can be any format supported by Import.

ExamplesExamplesopen allclose all

Basic Examples  (5)Basic Examples  (5)

Execute a URL and import the result from a JSON API:

In[1]:=
Click for copyable input
Out[1]//Short=

Execute PlaceHold.it API and import the result as an image:

In[1]:=
Click for copyable input
Out[1]=

Create a deck of cards on http://deckofcardsapi.com:

In[1]:=
Click for copyable input
Out[1]=

Draw four cards from this deck:

In[2]:=
Click for copyable input
Out[2]=

Show the cards:

In[3]:=
Click for copyable input
Out[3]=

Execute an APIFunction:

In[1]:=
Click for copyable input
Out[1]=

URL objects can be used:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2014
(10.0)
| Updated in 2016
(11.0)
Translate this page: