Skip to content

Commit 3eb7364

Browse files
committed
Change the python views -> http method type for /simulated_load from GET to POST due to potential payload size
Even though the GET method works, for large payloads in particular, this should be a POST.
1 parent 0ad9f64 commit 3eb7364

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

julia_src/http.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -821,7 +821,7 @@ HTTP.register!(ROUTER, "GET", "/avert_emissions_profile", avert_emissions_profil
821821
HTTP.register!(ROUTER, "GET", "/cambium_profile", cambium_profile)
822822
HTTP.register!(ROUTER, "GET", "/easiur_costs", easiur_costs)
823823
HTTP.register!(ROUTER, "GET", "/sector_defaults", sector_defaults)
824-
HTTP.register!(ROUTER, "GET", "/simulated_load", simulated_load)
824+
HTTP.register!(ROUTER, "POST", "/simulated_load", simulated_load)
825825
HTTP.register!(ROUTER, "GET", "/absorption_chiller_defaults", absorption_chiller_defaults)
826826
HTTP.register!(ROUTER, "GET", "/ghp_efficiency_thermal_factors", ghp_efficiency_thermal_factors)
827827
HTTP.register!(ROUTER, "GET", "/ground_conductivity", ground_conductivity)

reoptjl/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ def simulated_load(request):
682682

683683
# json.dump(inputs, open("sim_load_post.json", "w"))
684684
julia_host = os.environ.get('JULIA_HOST', "julia")
685-
http_jl_response = requests.get("http://" + julia_host + ":8081/simulated_load/", json=inputs)
685+
http_jl_response = requests.post("http://" + julia_host + ":8081/simulated_load/", json=inputs)
686686
response_data = http_jl_response.json()
687687
# Round all scalar/monthly outputs to 2 decimal places
688688
load_profile_key = next((k for k in response_data if "loads_" in k), None)

0 commit comments

Comments
 (0)