Ticket #359 (closed feature: fixed)

Opened 10 months ago

Last modified 10 months ago

Add Way to Read in Files URLs

Reported by: jresig Assigned to: dherman
Type: feature Priority: major
Milestone: Component: RefImpl
Version: 4 Keywords:
Cc:

Description

A simple way to load files over the network would be incredibly useful, like in the following:

  var contents = intrinsic::readURL("http://google.com/");

Text-only files would be sufficient.

Attachments

Change History

Changed 10 months ago by dherman

  • status changed from new to closed
  • resolution set to fixed

I've committed a simplistic implementation of this. It's HTTP only, text only. The intrinsic::readURL function takes a string (HTTP URL) and optionally a string for the HTTP method and an object mapping header keys to header strings. It returns an object with four fields:

{
    status: uint,
    statusText: string,
    headers: Object,
    responseText: string
}
Note: See TracTickets for help on using tickets.