Skip to content

Commit

Permalink
Update curl header information for Linux distros #1830
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanzou committed Aug 16, 2024
1 parent f6305b8 commit 6a033a0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/invoke.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6071,11 +6071,13 @@ static void fcall_reopt_size_battery(lk::invoke_t& cxt)
wxString post_url = SamApp::WebApi("reopt_post");
post_url.Replace("<SAMAPIKEY>", wxString(sam_api_key));

// reopt_jsonpost = "'" + reopt_jsonpost + "'"; // Not valid JSON on Windows

wxEasyCurl curl;
// curl.AddHttpHeader("Accept: application/json");
// curl.AddHttpHeader("Content-Type: application/json");
curl.AddHttpHeader("Content-Type: application/json");
curl.AddHttpHeader("Accept: application/json");
// curl.AddHttpHeader("Accept: application/json");
curl.SetPostData(reopt_jsonpost);

// write to file for SAM issue 1830
Expand All @@ -6088,6 +6090,9 @@ static void fcall_reopt_size_battery(lk::invoke_t& cxt)
file.Write(reopt_jsonpost);
file.Close();

// post_url = "'" + post_url + "'"; // lk error on Windows
// post_url = "\"" + post_url + "\""; // lk error on Windows

wxString msg, err;
if (!curl.Get(post_url, msg))
{
Expand Down

0 comments on commit 6a033a0

Please sign in to comment.