Last active
December 18, 2015 15:49
-
-
Save pierreant-p/5806781 to your computer and use it in GitHub Desktop.
Sample code for uploading to Sketchfab in C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Ensure that you have MultipartForm imported in your project | |
*/ | |
string url = @ "https://api.sketchfab.com/v1/models"; | |
MultipartForm form = new MultipartForm (url); | |
form.SetField ("title", "Uber Glasses"); | |
form.SetField ("description", "Test of the api with a simple model"); | |
form.SetField ("token", "FF00FF"); | |
form.SetField ("tags", "test collada glasses"); | |
form.SetField ("private", 1); | |
form.SetField ("password", "Tr0b4dor&3"); | |
password="" | |
form.SendFile (p_pathAndFileName); // The file path to upload. | |
string response = form.ResponseText.ToString (); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment