title: Request payload - Uploading a picture
body: <p>I'm very familiar with Python's request library and have a good understanding about making requests. However, I have run into this particular payload for a certain POST request, and I am not really sure how it should be handled.</p>
  
  <pre><code>------WebKitFormBoundary9Bj6df0ErrnOvlr8
  Content-Disposition: form-data; name="upload_id"
  
  1532472043020
  ------WebKitFormBoundary9Bj6df0ErrnOvlr8
  Content-Disposition: form-data; name="photo"; filename="photo.jpg"
  Content-Type: image/jpeg
  
  
  ------WebKitFormBoundary9Bj6df0ErrnOvlr8
  Content-Disposition: form-data; name="media_type"
  
  1
  ------WebKitFormBoundary9Bj6df0ErrnOvlr8--
  </code></pre>
  
  <p>This payload is for uploading a picture to instagram.com with a simple web request.</p>
  
  <p><strong>Question:</strong></p>
  
  <p><em>How does this payload translate to me selecting a picture on my desktop. Where would the file path come into play?</em></p>
  
  <hr>
  
  <p>Here is the code that is used to login into instagram.com. Please note that this is a method that is apart of a class I created. (Where the constructor takes ones username and password as parameters.  </p>
  
  <pre><code>def logIn(self):
          self.loginPage = 'https://www.instagram.com/accounts/login/ajax/'
          self.userAgent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36'
          self.session.get(self.loginPage, proxies = {'http' : self.proxy, 'https' : self.proxy})
          self.session.headers = {'user-agent': self.userAgent}
          self.session.headers.update({'Referer': self.refererUrl, 'x-csrftoken': self.session.cookies['csrftoken']})
          loginData = {
              'username': self.username, 
              'password': self.password 
          }
  
          loginToPage = self.session.post(self.loginPage, data=loginData, allow_redirects=True, proxies = {'http' : self.proxy, 'https' : self.proxy})
          self.session.headers.update({'x-csrftoken': self.session.cookies['csrftoken']})
          loginText = json.loads(loginToPage.text)
          print(loginToPage.text)
  </code></pre>
  
  <p>Here is also the request URL, that requires the payload above: <a href="https://www.instagram.com/create/upload/photo/" rel="nofollow noreferrer">https://www.instagram.com/create/upload/photo/</a></p>