Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

207
Vistas
How to toggle unleash feature flag through api for a specific environments

In my project, I have three environments and I want to toggle a feature flag only on for a specific environment Is it possible to toggle unleash feature flag with API for a development environment only? I am using the below code to toggle the flag but it works for default mode only

function enabledToggle() { axios .get("http://unleash.host.com/api/admin/features/:featureName/toggle/on", { headers: { Authorization: ${"my-token"}, } }) .then(function (response) { console.log(response.data); }) .catch(function (error) { console.log(error); }); }

I also tried one more way but I got this error I am trying to turn on the feature flag through this API but I am getting an error when I execute the above function I am getting this error Request failed with status code 415 can anyone help what I am doing wrong? here is my code

function oNFeatureFlag(){

axios({url:"https://host.name/api/admin/projects/default/features/feature-name/environments/development/on", headers: {Authorization: ${"my token"},}, method: "post", }) .then(function (response) { console.log(response); }) .catch(function (error) { console.log(error); });}

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try setting content-type to application/json explicitly.

This is most likely because of the way Axios sets the content-type header. From what I understand, it sets content-type to application/json;charset=utf-8. Prior to a recent version of Unleash, Unleash didn't parse this properly, so it would give you a 415 Unsupported Media Type response.

For reference, here's the same question as a GitHub issue.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda