Exemple #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);
        }
Exemple #2
0
        public void destroy_geo_cache(int geo_cache_id, RequestCallback callback)
        {
            HTTP http = HTTP.post(url_to("api/geo_caches/" + geo_cache_id));

            http.request.method = "DELETE";
            http.send(this, callback);
        }
Exemple #3
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);
        }
Exemple #4
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);
        }
Exemple #5
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);
        }
Exemple #6
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);
        }
Exemple #7
0
        //This differs from the other HTTP static methods in that is doesn't return anything and only fetches the HEADER info from the url
        //It also uses a different method in the RequestHandler which doesn't deal with status codes and only returns the Content-Type into the callback.
        //This is the one route which will make calls to other sites, but only to urls entered by the user for images
        internal static void verify_image(string url, ImageUrlCheck callback)
        {
            HTTP http = new HTTP();

            http.request        = UnityWebRequest.Get(url);
            http.request.method = "HEAD";
            http.send(callback);
        }