示例#1
0
        public void search_geo_caches(WWWForm search_params, RequestCallback callback)
        {
            HTTP http = HTTP.post(url_to("api/geo_caches/search"), search_params);

            http.set_header("Content-Type", "multipart/form-data");
            http.send(this, callback);
        }
示例#2
0
        public void lookup_parts(WWWForm part_info, RequestCallback callback)
        {
            HTTP http = HTTP.post(url_to("api/lookup_parts"), part_info);

            http.set_header("Content-Type", "multipart/form-data");
            http.send(this, callback);
        }
示例#3
0
        //Craft POST and PUT requests

        //Send new craft to Mun....or KerbalX.com as a POST request
        public void upload_craft(WWWForm craft_data, RequestCallback callback)
        {
            HTTP http = HTTP.post(url_to("api/craft"), craft_data);

            http.set_header("Content-Type", "multipart/form-data");
            http.send(this, callback);
        }
示例#4
0
        public void update_geo_cache(int geo_cache_id, WWWForm geo_cache_data, RequestCallback callback)
        {
            HTTP http = HTTP.post(url_to("api/geo_caches/" + geo_cache_id), geo_cache_data);

            http.request.method = "PUT";
            http.set_header("Content-Type", "multipart/form-data");
            http.send(this, callback);
        }
示例#5
0
        //Update existing craft on KerbalX as a PUT request with the KerbalX database ID of the craft to be updated
        public void update_craft(int id, WWWForm craft_data, RequestCallback callback)
        {
            HTTP http = HTTP.post(url_to("api/craft/" + id), craft_data);

            http.request.method = "PUT"; //because unity's PUT method doesn't take a form, so we create a POST with the form and then change the verb.
            http.set_header("Content-Type", "multipart/form-data");
            http.send(this, callback);
        }