# setWindCondition **Endpoint:** `POST https://firesim.cs.gsu.edu/api/setWindCondition` Set wind speed and direction. Both parameters are optional; omitted values default to 0. ## Parameters | Name | Type | Required | Default | Description | |------|------|----------|---------|-------------| | `userToken` | string | yes | — | Your simulation token. | | `windSpeed` | number (double) | no | 0 | Wind speed. Default 0. | | `windDirection` | number (double) | no | 0 | Wind direction in degrees (south=0, clockwise). Default 0. | ## Responses ### HTTP 200 Wind condition set successfully. **Example:** ```json "Set wind conditions" ``` ### HTTP 500 Internal server error (Spring JSON). Returned when `userToken` is missing or invalid — the server cannot locate the simulation instance for that token. **Example:** ```json { "timestamp": "2026-05-20T16:41:23.926+00:00", "status": 500, "error": "Internal Server Error", "path": "/api/setWindCondition" } ``` ## Examples ### Python ```python import requests base_url: str = "https://firesim.cs.gsu.edu/api/setWindCondition/" params: dict[str, float | str] = { "userToken": "abc123xyz", "windSpeed": 5.0, # optional, default 0 "windDirection": 180.0, # optional, default 0 } response = requests.post(base_url, params=params) print(response.text) ``` ### JavaScript ```javascript /** @type {string} */ const BASE_URL = "https://firesim.cs.gsu.edu/api/setWindCondition/"; const params = { userToken: "abc123xyz", windSpeed: 5.0, // optional, default 0 windDirection: 180.0, // optional, default 0 }; const url = new URL(BASE_URL); Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v)); fetch(url.toString(), { method: "POST" }) .then(res => res.text()) .then(console.log); ``` ### cURL ```bash BASE_URL="https://firesim.cs.gsu.edu/api/setWindCondition/" curl -s -X POST \ -G --data-urlencode "userToken=abc123xyz" \ -G --data-urlencode "windSpeed=5.0" \ # optional, default 0 -G --data-urlencode "windDirection=180.0" \ # optional, default 0 "$BASE_URL" ``` ### Java ```java import java.net.URI; import java.net.http.*; String BASE_URL = "https://firesim.cs.gsu.edu/api/setWindCondition/"; String queryString = "userToken=abc123xyz" + "&" + "windSpeed=5.0" + "&" + // optional, default 0 "windDirection=180.0"; // optional, default 0 HttpRequest request = HttpRequest.newBuilder() .uri(URI.create(BASE_URL + "?" + queryString)) .POST(HttpRequest.BodyPublishers.noBody()) .build(); HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString()); System.out.println(response.body()); ``` ### Go ```go import ( "fmt" "io" "net/http" "net/url" ) baseURL := "https://firesim.cs.gsu.edu/api/setWindCondition/" params := url.Values{} params.Set("userToken", "abc123xyz") params.Set("windSpeed", "5.0") // optional, default 0 params.Set("windDirection", "180.0") // optional, default 0 resp, _ := http.PostForm(baseURL, params) defer resp.Body.Close() body, _ := io.ReadAll(resp.Body) fmt.Println(string(body)) ``` ### Rust ```rust use reqwest::blocking::Client; let base_url = "https://firesim.cs.gsu.edu/api/setWindCondition/"; let params = vec![ ("userToken", "abc123xyz"), ("windSpeed", "5.0"), // optional, default 0 ("windDirection", "180.0"), // optional, default 0 ]; let client = Client::new(); let response = client.post(base_url).query(¶ms).send().unwrap(); println!("{}", response.text().unwrap()); ```