easyDL通用请求方法
@param url 服务的url
@param image 图片本地路径
@param options 可选参数
@return Json返回
192635
public JSONObject sendImageRequest(String url, String image, HashMap<String, Object> options) {
        try {
            byte[] data = Util.readFileByBytes(image);
            return sendImageRequest(url, data, options);
        } catch (IOException e) {
            e.printStackTrace();
            return AipError.IMAGE_READ_ERROR.toJsonResult();
        }
    }
831556
def image(id, options={})
      params = options
      get(surl('image') + id, params).body
    end
862601
private String requestWebPage(URL url) throws FanartTvException {
        try {
            HttpGet httpGet = new HttpGet(url.toURI());
            httpGet.addHeader("accept", "application/json");
            final DigestedResponse response = DigestedResponseReader.requestContent(httpClient, httpGet, charset);

            if (response.getStatusCode() >= 500) {
                throw new FanartTvException(ApiExceptionType.HTTP_503_ERROR, response.getContent(), response.getStatusCode(), url);
            } else if (response.getStatusCode() >= 300) {
                throw new FanartTvException(ApiExceptionType.HTTP_404_ERROR, response.getContent(), response.getStatusCode(), url);
            }

            return response.getContent();
        } catch (URISyntaxException ex) {
            throw new FanartTvException(ApiExceptionType.CONNECTION_ERROR, "Invalid URL", url, ex);
        } catch (IOException ex) {
            throw new FanartTvException(ApiExceptionType.CONNECTION_ERROR, "Error retrieving URL", url, ex);
        }
    }
228997
def generate_image_from_url(url=None, timeout=30):
    

    file_name = posixpath.basename(url)
    img_tmp = NamedTemporaryFile(delete=True)

    try:
        response = requests.get(url, timeout=timeout)
        response.raise_for_status()
    except Exception as e:  # NOQA
        return None, None

    img_tmp.write(response.content)
    img_tmp.flush()

    image = File(img_tmp)
    image.seek(0)

    return file_name, image
1204624
static public function getJson($url, $data=null, $options=null)
    {
        $instance = new static('GET', $url, $data, $options);
        return $instance->toJson();
    }
512850
function(image, options) {
        var index = options.imageMaskIndex || this.options.imageMaskIndex;
        if (!index)
            return;
        if (typeof index === 'function') {
            index = index(image, options);
        }
        return index;
    }
88285
public static function doCurlJson($url, $data = null, $header = null, $option = [])
    {
        return json_decode(self::doCurl($url, $data, $header, $option), true);
    }
431697
def _image_url(array, fmt='png', mode="data", quality=90, domain=None):
  
  supported_modes = ("data")
  if mode not in supported_modes:
    message = "Unsupported mode '%s', should be one of '%s'."
    raise ValueError(message, mode, supported_modes)

  image_data = serialize_array(array, fmt=fmt, quality=quality)
  base64_byte_string = base64.b64encode(image_data).decode('ascii')
  return "data:image/" + fmt.upper() + ";base64," + base64_byte_string
309130
def as_json(options={})
      self.attributes.merge({
        :images => if self.product_images.any?
          self.product_images
        else
          [self.product.product_images.first]
        end
      })
    end
350151
public JSONObject animalDetect(byte[] image, HashMap<String, String> options) {
        AipRequest request = new AipRequest();
        preOperation(request);
        
        String base64Content = Base64Util.encode(image);
        request.addBody("image", base64Content);
        if (options != null) {
            request.addBody(options);
        }
        request.setUri(ImageClassifyConsts.ANIMAL_DETECT);
        postOperation(request);
        return requestServer(request);
    }
299230
public static function image($url, $name = null, $options = [])
    {
        $options['src'] = $url;

        self::exclure($options);

        return self::input('image', $name, null, $options);
    }
1206997
function Texture2D (opts) {
    var file    = opts.file
      , url     = opts.url
      , data    = opts.data
      , texture = opts.texture

    if (url) {
        this.name = url
        data = new Image()
        data.src = url
    } else if (file) {
        this.name = file
        data = resource(file)
    } else if (texture) {
        this.name = texture.name
        data = texture.imgElement
    }

    this.size = {width: 0, height: 0}

    if (data instanceof RemoteResource) {
        events.addListenerOnce(data, 'load', this.dataDidLoad.bind(this, data))
        this.imgElement = data.load()
    } else if (url) {
        this.imgElement = data
        this.imgElement.onload = this.dataDidLoad.bind(this, data)
    } else {
        this.imgElement = data
        this.dataDidLoad(data)
    }
}
968082
public void setImageUrl(final String imageUrl) {
		ImageModel model = getOrCreateComponentModel();
		model.imageUrl = imageUrl;
		model.image = null;
	}
828759
public static JsonRtn shortUrl(License license, String url) {
        if (StringUtils.isEmpty(url)) {
            return JsonRtnUtil.buildFailureJsonRtn(JsonRtn.class, "missing url");
        }

        Map<String, String> paramMap = ImmutableMap.of("action", "long2short", "long_url", url);
        return HttpUtil.postBodyRequest(WechatRequest.SHORT_URL, license, paramMap, JsonRtn.class);
    }
1301084
function () {
    // Create request options from parsed source URL
    var options = url.parse(this.source, false);

    // Add on some defaults
    extend(options, {
      method: 'get',
      headers: {
        host: options.host,
        accept: 'image/*'
      }
    });

    // Determine https/http from source URL
    var library = options.protocol === 'https:' ? https : http;

    // Setup the request and its event binds
    this.request = library.request(options);
    this.request.on('response', this.onResponse.bind(this));
    this.request.on('error', this.onError.bind(this));
    this.request.setTimeout(5000, this.onTimeout.bind(this));

    // Start the download
    this.startTime = new Date().getTime();
    this.request.end();
  }
855969
public JSONObject bodyAnalysis(byte[] image, HashMap<String, String> options) {
        AipRequest request = new AipRequest();
        preOperation(request);
        
        String base64Content = Base64Util.encode(image);
        request.addBody("image", base64Content);
        if (options != null) {
            request.addBody(options);
        }
        request.setUri(BodyAnalysisConsts.BODY_ANALYSIS);
        postOperation(request);
        return requestServer(request);
    }
1082233
function urlmon(options) {
    
    this.url = options.url;
    this.interval = options.interval || 5000;
    this.timeout = options.timeout || 3000;
    this.handle = null;
        
}