-
Notifications
You must be signed in to change notification settings - Fork 48
HTTP POST setup
As of UXF 2.2.0, you can enable the HTTP POST Data Handler in the Data Handling settings in the Session component. This data handler sends POST requests to a URL, with a file path and data (formatted as a string). To get this to work, you need a HTTP server (e.g. written in PHP, Python, etc) that accepts post requests and does something with the data (e.g. writes to a file). The server needs to:
- Accept a POST request.
- Handle the form provided in the request. This data handler by default sends the data (formatted as a string) with the
data
key and the desired filename with thefilename
key. - For WebGL builds, due to security restrictions, the server must be authorised for Cross Origin Resource Sharing (CORS).
- Optionally it can support Basic HTTP authentication.
- For security, you should be using HTTPS.
A sample server has been written in Python using Flask. This does the bare minimum, simply writing the data to a file, preserving the folder structure of the file output. Use it, or configure it for your own needs.
Link to Flask web server sample
Install requirements:
pip install Flask Flask-HTTPAuth Flask-CORS
The server can run locally (python webserver_example.py
), and then you can configure the data handler so that the URL points to the local address (i.e. http://127.0.0.1:5000/form
).
When running on your server you should use python webserver_example.py --host=0.0.0.0
, then in Unity you can enter the public IP, or domain name, as the address (e.g. https://123.456.78.910/form
).
You can configure the Data Handler using the inspector to enter your URL, and optional username and password:
๐ง Core topics
- ๐ Background
- โจ UXF 2.0
- โ๏ธ Compatibility
- ๐ถ๏ธ Oculus Quest Setup
- ๐ญ Concepts
- ๐ ๏ธ Get started
- ๐ Examples
- ๐ฅ๏ธ Built-in UI
- ๐ Session generation
- โฐ Events
- ๐ Data collection
- โ๏ธ Collect custom data
- ๐ Custom Data Handler
- ๐ Remote Data Collection
- ๐๏ธ WebGL DynamoDB setup
- ๐ Processing DynamoDB CSVs
- ๐ซ HTTP Post Setup
- ๐ง Settings system
- ๐๐ฝ Tracker system
- ๐ Logging system
โ ๏ธ Common issues- ๐ผ๏ธ Multi-scene experiments
- ๐บ Videos
- ๐จโ๐ Full written tutorial
- ๐ฆ Asset links
- ๐จโ๐ซ Unity tutorial links
- ๐ Useful code snippets
- ๐ก Programming ideas
- ๐งฎ Example R processing