requestCrossOrigin static method

Future<String> requestCrossOrigin(
  1. String url, {
  2. String? method,
  3. String? sendData,
})

Makes a cross-origin request to the specified URL.

This API provides a subset of request which works on IE9. If IE9 cross-origin support is not required then request should be used instead.

Implementation

static Future<String> requestCrossOrigin(
  String url, {
  String? method,
  String? sendData,
}) async {
  final xhr = await request(url, method: method, sendData: sendData);
  return xhr.response as String;
}