Search Unity

Sending an image in the body of a POST request and get json returned

Discussion in 'Scripting' started by eco_bach, Jun 1, 2020.

  1. eco_bach

    eco_bach

    Joined:
    Jul 8, 2013
    Posts:
    1,601
    Building a straightforward webcam image capture application but the server requirements have changed. Now I am being asked to send the image in the body of a post request and to listen for a json response.

    ie to
    Code (CSharp):
    1. http://localhost:8008/api/recognize
    Assuming the image exists in the following directory

    /home/user/webcam/

    how might I accomplish this?
     
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,735
    Check our documentation for UnityWebRequest.Post