Skip to content

Instantly share code, notes, and snippets.

@pierreant-p
Last active December 18, 2015 15:49
Show Gist options
  • Save pierreant-p/5806781 to your computer and use it in GitHub Desktop.
Save pierreant-p/5806781 to your computer and use it in GitHub Desktop.
Sample code for uploading to Sketchfab in C#
/**
* 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