title: How to send image from image Uri through HTTP request? (React Native and Django Backend)
body: <p>I’m using Expo’s image picker and I’m getting this output:</p>
  
  <pre><code>Object {
    "cancelled": false,
    "height": 468,
    "uri": "file:///data/user/0/host.exp.exponent/cache/ExperienceData/%2540jbaek7023%252Fstylee/ImagePicker/9a12f0a3-9260-416c-98a6-51911c91ddf4.jpg",
    "width": 468,
  }
  </code></pre>
  
  <p>I could render my image, but I just realized that the URL is the <strong>phone’s local URI</strong>. </p>
  
  <p>I’m using Redux-Thunk and Axios to send <strong>HTTP POST request</strong>:</p>
  
  <pre><code>export const sendPost = ( imageUri, title, content ) =&gt; async dispatch =&gt; {
    let response = await axios.post(`${ROOT_URL}/rest-auth/registration/`, {
      image, &lt;&lt;&lt;&lt;- I can't put image uri here :( it's LOCAL path
      title,
      content
    })
  
    if(response.data) {
      dispatch({ type: POST_CREATE_SUCCESS, payload: response.data.token })
    } else {
      dispatch({ type: POST_CREATE_FAIL })
    }
  }
  </code></pre>
  
  <p><strong>UPDATE</strong> I changed a request call </p>
  
  <pre><code>let headers = { 'Authorization': `JWT ${token}`};
    if(hType==1) {
      headers = { 'Authorization': `JWT ${token}`};
    } else if (hType==2) {
      headers = { 'Authorization': `Bearer ${token}`};
    }
  
  let imageData = new FormData();
  imageData.append('file', { uri: image });
  let response = await axios.post(`${ROOT_URL}/clothes/create/`, {
      image: imageData,
      text, bigType, onlyMe ...
    }, {headers});
  </code></pre>
  
  <p>!! sorry for the complication but image variable name; <code>image</code> is <code>uri</code> for the image. I didn't want to change the name of original variable name</p>
  
  <p>and on server, it's printing </p>
  
  <pre><code>'image': {'_parts': [['file', {'uri': 'file:///data/user/0/host.exp.exponent
      /cache/ExperienceData/%2540jbaek7023%252Fstylee/
      ImagePicker/78f7526a-1dfa-4fc9-b4d7-2362964ab10d.jpg'}]]}
  </code></pre>
  
  <p>I found that gzip compression is a way to send image data. Does it help?</p>