HISE Logo Forum
    • Categories
    • Register
    • Login
    1. HISE
    2. Daanyoo
    D
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 11
    • Groups 0

    Daanyoo

    @Daanyoo

    1
    Reputation
    1
    Profile views
    11
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    Daanyoo Unfollow Follow

    Best posts made by Daanyoo

    • RE: callWithPOST change content type

      @Christoph-Hart this is how im passing the JSON data:

      inline function requestDirectLicenseActivation(deviceName, deviceSignature, accessToken)
          {
              local requestData = {
                  "deviceName": deviceName,
                  "deviceSignature": deviceSignature
              };
              
              currentAccessToken = accessToken;
              
              makeHttpRequest("POST", "/client/licenses/" + PRODUCT_ID + "/request", trace(requestData), handleDirectLicenseResponse);
          }
      

      Even when converting the JSON object using trace, I'm getting the 415 error due to an unsupported media type, as the endpoint will not receive the content as application/json, as its converted to x-www-form-urlencoded data.

      a7efb73a-5e4a-4f34-ad20-59419326215a-image.png

      posted in General Questions
      D
      Daanyoo

    Latest posts made by Daanyoo

    • RE: callWithPOST change content type

      @Christoph-Hart I found the mistake - I had accidently reset the Server.HttpHeader() of the request when passing it into the makeHttpRequest function. Therefore only the the Auth Bearer Token was passed and the Content-Type was automatically set by HISE. Now I correctly appended the Bearer Token within the request and everything works perfectly fine :)

      Thank you guys so much for your help, I really appreciate it!!

      posted in General Questions
      D
      Daanyoo
    • RE: callWithPOST change content type

      @Christoph-Hart this is how im passing the JSON data:

      inline function requestDirectLicenseActivation(deviceName, deviceSignature, accessToken)
          {
              local requestData = {
                  "deviceName": deviceName,
                  "deviceSignature": deviceSignature
              };
              
              currentAccessToken = accessToken;
              
              makeHttpRequest("POST", "/client/licenses/" + PRODUCT_ID + "/request", trace(requestData), handleDirectLicenseResponse);
          }
      

      Even when converting the JSON object using trace, I'm getting the 415 error due to an unsupported media type, as the endpoint will not receive the content as application/json, as its converted to x-www-form-urlencoded data.

      a7efb73a-5e4a-4f34-ad20-59419326215a-image.png

      posted in General Questions
      D
      Daanyoo
    • RE: callWithPOST change content type

      @Christoph-Hart Another problem im still facing is the JSON encoding issue that was also mentioned in the linked thread.

      Im struggling to send a POST with regular application/json Data, as HISE seems to package the data into x-www-form-urlencoded when using Server.callWithPOST. Everytime I'm trying to send out a POST request to receive a license token I'm getting a 415 error.

      Do you have any idea how to change the format of the request in a way that the regular JSON dictionary will be transferred?

      Checked the request and its format with Postman:

      Using the x-www-form-urlencoded (same as HISE probably uses)
      5c7b66c0-204c-4174-83e6-ed99d367c242-image.png

      Using the JSON dictionary to receive a license token:
      559a71c8-fbbf-44d1-ac37-b11a10daa41b-image.png

      posted in General Questions
      D
      Daanyoo
    • RE: callWithPOST change content type

      @Christoph-Hart That was the solution! Thank you so much!!!

      posted in General Questions
      D
      Daanyoo
    • RE: callWithPOST change content type

      @Christoph-Hart Okay great, this fix already allowed me to pass the plain string into the function.

      Another problem, that also was mentioned in the referenced thread is that data is not being processed as text/plain or plain JSON as it looks like HISE is sending the data as URL-encoded form data (like a web form submission)

      This leads to problems in calling the sign-in API endpoint of Moonbase - this is how Moonbase expects to receive sign-in data:

      POST https://demo.moonbase.sh/api/customer/identity/sign-in?email=test@example.com
      Content-Type: text/plain
      
      Password1234!
      

      I need to embed the mail into the URL endpoint and pass on the password as plain text. This is how I implemented it within HISE:

      makeHttpRequest("POST", "/customer/identity/sign-in?email=" + email, password, function(success, response)
      

      Due to the faulty URL encoding the data is being received in the format shown below:

      3a248157-0ea9-4a66-b1e2-c01622177b33-image.png

      I am not sure how to create a workaround for this..

      posted in General Questions
      D
      Daanyoo
    • callWithPOST change content type

      Re: Server.callWithPost content type

      Hello everyone,

      I'm currently working on implementing a licensing system using Moonbase within HISE. One issue I recently faced regarding user sign-in was working with the callWithPOST function. As the Moonbase API requires me to pass text/plain instead of a json object, I can't get the sign-in to properly work. Is there any way to just pass a simple string via the callWithPOST function? anyone else, who faced a similar issue and found an workaround?

      Moonbase Docs Sign-In: https://moonbase.sh/docs/licensing/api/#sign-in-a-customer

      inline function makeHttpRequest(method, endpoint, data, callback)
          {        
              // Set base URL
              Server.setBaseURL(MOONBASE_API);
              Server.setHttpHeader("Content-Type: text/plain");
              
              currentHttpCallback = callback;
           
              if (method == "POST") {
                  Server.callWithPOST(endpoint, data, function(status, response) {
                      if (status == Server.StatusOK) {
                          Console.print("LicenseManager: Request successful");
                          currentHttpCallback(true, response);
                      } else {
                          Console.print("LicenseManager: Request failed with status: " + status);
                          currentHttpCallback(false, {"error": "HTTP " + status});
                      }
                  });
              } else {
                  Server.callWithGET(endpoint, data, function(status, response) {
                      if (status == Server.StatusOK) {
                          Console.print("LicenseManager: Request successful");
                          currentHttpCallback(true, response);
                      } else {
                          Console.print("LicenseManager: Request failed with status: " + status);
                          currentHttpCallback(false, {"error": "HTTP " + status});
                      }
                  });
              }
          }
      
      /**
           * Sign in customer to get access token
           */
          inline function signInCustomer(email, password, callback)
          {        
              // Store callback in global variable for nested function access
              currentSignInCallback = callback;
              
              // Make sign-in request
              makeHttpRequest("POST", "/customer/identity/sign-in?email=" + email, password, function(success, response) {
                  if (success) {
                      Console.print("LicenseManager: Sign-in response received");
                      // Parse JSON response directly without storing in variable
                      if (isDefined(parseSimpleJSON(response).accessToken)) {
                          Console.print("LicenseManager: Access token received");
                          currentSignInCallback(true, parseSimpleJSON(response));
                      } else {
                          Console.print("LicenseManager: No access token in response");
                          currentSignInCallback(false, "No access token received");
                      }
                  } else {
                      Console.print("LicenseManager: Sign-in request failed");
                      currentSignInCallback(false, "Sign-in request failed");
                  }
              });
          }
      

      @tobbentm any recommendation from your side on implementation? why cant we just pass json with the sign-in function? would have loved to use the JUCE module from you, but as you already pointed out, this is only compatible with JUCE 7.

      Any help is greatly appreciated!

      posted in General Questions
      D
      Daanyoo
    • RE: Compile error macOS Tahoe: error Cycle inside a single target

      @Christoph-Hart haha, absolute madness from Apple, no one could have expected such an unnecessary change
      thank you for the quick fix, that was indeed the solution - now the export runs just fine! you saved me from downgrading my OS again^^

      Lets see when I will encounter my next bug with this new macOS update...

      posted in General Questions
      D
      Daanyoo
    • Compile error macOS Tahoe: error Cycle inside a single target

      Re: ERROR: Cycle inside a single target

      Hello everyone,

      as I already upgraded to macOS Tahoe recently I was hoping to be able to go through the compilation process of my VSTi plugin as I have been before. Unfortunately I'm getting the same error as mentioned in the referenced thread..

      ⚠️ Building targets in manual order is deprecated - check "Parallelize build for command-line builds" in the project editor, or set DISABLE_MANUAL_TARGET_ORDER_BUILD_WARNING in any of the targets in the current build to suppress this warning
      note: Target dependency graph (3 targets)
      ❌ error: Cycle inside a single target; building could produce unreliable results.
      ** BUILD FAILED **

      Standalone Export goes through just fine...

      @Christoph-Hart One thing I noticed in the previous thread was a message from Christoph implementing a fix regarding the Copy Step - he then committed a fix, which should hold until macOS 20
      Now we made the jump to macOS 26^^ so this is the reminder haha

      I'm on the latest commit of the development branch and already tried downgrading to xcode 16.4, both unfortunately not working...

      Any help is greatly appreciated!

      posted in General Questions
      D
      Daanyoo
    • RE: Save Effects and Modulation in Factory Presets

      @d-healey I also saw this old post from you, where you build some sort of factory preset system: https://forum.hise.audio/topic/324/factory-preset-creator

      Do you feel that such an approach would still be suitable for the current state of HISE?

      posted in Presets / Scripts / Ideas
      D
      Daanyoo
    • RE: Save Effects and Modulation in Factory Presets

      @d-healey Is an UI component like a sliderpack mandatory in order to save the state of an effect? My preference would be that I do not have to link the effect/modulations to UI as users will never be able to configure these on their own.

      posted in Presets / Scripts / Ideas
      D
      Daanyoo