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

158
Vistas
format issue when saving captured data with request.POST

The data is being captured, however when saving to the database it is being saved with quotes and square brackets.

def create_flow_and_phases(request):


    data = {
        "name": request.POST['new_flow_name'],
        "description": request.POST['flow_description'],
        "category": request.POST['select_category'],
        "precedents": [request.POST['precedent_list']],
        "users": [1],
        "phases": ''
    }

    # Making a POST request to save flow_and_phases
    url = API_HOST + "/api/flows/save_flow_and_phases/"

    answer = requests.post(url, data=data, headers={'Authorization': 'Token ' + request.session['user_token']})

    if not answer.ok:
        raise Exception("An error occurred while creating flow.")

Example of data in DB: Name: ['test']

I'm using Django Framework

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

I needed to pass the data dictionary as a JSON and it worked

answer = requests.post(url, json=data, headers={'Authorization': 'Token ' + request.session['user_token']})
over 4 years ago · Santiago Trujillo 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