[]
        
(Showing Draft Content)

WEBSERVICE

This function returns data from a web service on the Internet or Intranet.

Syntax

WEBSERVICE(url)

Arguments

This function has the following argument:

Argument

Description

url

[required] The URL of the web service to be called.

Remarks

The function supports HTTP (http and https) protocol. SpreadJS return "" as default value before the result is returned from the service. The correct result is displayed only when the response result is string type. If other formats like images, audio, video are used, it returns unreadable code.


The function returns a #VALUE! error in following scenarios:

  • If the returned URL is a string with more than 2048 characters.

  • If the request takes more than 10 seconds.

  • If the request does not follow the same origin policy and the target website does not support CORS (Cross-Origin Resource Sharing) from source origin, on browser. In such case, the browser prints CORS Error on console instead of SpreadJS.

  • If FTP or FILE protocol is used.

Data Types

This function accepts and returns string data.

Examples

WEBSERVICE("https://restcountries.eu/rest/v2/all")


WEBSERVICE("https://jsonplaceholder.typicode.com/users")


WEBSERVICE("https://www.google.com")