class_docstr: File from URL wrapper.
  
  The :class:`FileFromURLWrapper` object gives you the ability to stream file
  from provided URL in chunks by :class:`MultipartEncoder`.
  Provide a stateless solution for streaming file from one server to another.
  You can use the :class:`FileFromURLWrapper` without a session or with
  a session as demonstated by the examples below:
  
  .. code-block:: py
  
      # no session
  
      import requests
      from requests_toolbelt import MultipartEncoder, FileFromURLWrapper
  
      url = 'https://httpbin.org/image/png'
      streaming_encoder = MultipartEncoder(
          fields={
              'file': FileFromURLWrapper(url)
          }
      )
      r = requests.post(
          'https://httpbin.org/post', data=streaming_encoder,
          headers={'Content-Type': streaming_encoder.content_type}
      )
  
  .. code-block:: py
  
      # using a session
  
      import requests
      from requests_toolbelt import MultipartEncoder, FileFromURLWrapper
  
      session = requests.Session()
      url = 'https://httpbin.org/image/png'
      streaming_encoder = MultipartEncoder(
          fields={
              'file': FileFromURLWrapper(url, session=session)
          }
      )
      r = session.post(
          'https://httpbin.org/post', data=streaming_encoder,
          headers={'Content-Type': streaming_encoder.content_type}
      )
class_docstr_tok: ["File","from","URL","wrapper",".","The",":","class",":","`","FileFromURLWrapper","`","object","gives","you","the","ability","to","stream","file","from","provided","URL","in","chunks","by",":","class",":","`","MultipartEncoder","`",".","Provide","a","stateless","solution","for","streaming","file","from","one","server","to","another",".","You","can","use","the",":","class",":","`","FileFromURLWrapper","`","without","a","session","or","with","a","session","as","demonstated","by","the","examples","below",":","..","code-block",":",":","py","#","no","session","import","requests","from","requests_toolbelt","import","MultipartEncoder",",","FileFromURLWrapper","url","=","'https",":","\/\/httpbin.org\/image\/png'","streaming_encoder","=","MultipartEncoder","(","fields=","{","'file","'",":","FileFromURLWrapper","(","url",")","}",")","r","=","requests.post","(","'https",":","\/\/httpbin.org\/post","'",",","data=streaming_encoder",",","headers=","{","'Content-Type","'",":","streaming_encoder.content_type","}",")","..","code-block",":",":","py","#","using","a","session","import","requests","from","requests_toolbelt","import","MultipartEncoder",",","FileFromURLWrapper","session","=","requests.Session","(",")","url","=","'https",":","\/\/httpbin.org\/image\/png'","streaming_encoder","=","MultipartEncoder","(","fields=","{","'file","'",":","FileFromURLWrapper","(","url",",","session=session",")","}",")","r","=","session.post","(","'https",":","\/\/httpbin.org\/post","'",",","data=streaming_encoder",",","headers=","{","'Content-Type","'",":","streaming_encoder.content_type","}",")"]
docstr: Make call for file under provided URL.
code: def _request_for_file(self, file_url):
      """Make call for file under provided URL."""
      response = self.session.get(file_url, stream=True)
      content_length = response.headers.get("content-length", None)
      if content_length is None:
          error_msg = (
              "Data from provided URL {url} is not supported. Lack of "
              "content-length Header in requested file response.".format(
                  url=file_url
              )
          )
          raise FileNotSupportedError(error_msg)
      elif not content_length.isdigit():
          error_msg = (
              "Data from provided URL {url} is not supported. content-length"
              " header value is not a digit.".format(url=file_url)
          )
          raise FileNotSupportedError(error_msg)
      return response
  
imports: import contextlib
  import io
  import os
  from uuid import uuid4
  import requests
  from .._compat import fields
label_desc: Use image node_id 2 for calling the FileFromURLWrapper obj's underlying member method code with example usage: obj._request_for_file(file_url) and returns: response