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

232
Vistas
Postman works in form data but not in raw or on my server for that matter

So the first piece of code is the backend end point and second is the front end. It does not send the token to an email address on the server or using Postman raw data. But it does send a token using form-data. Any ideas I'm new to this. thanks

class RegisterView(View):

    def post(self, request, *args, **kwargs):
        data = request.POST.get('email')
        check_if_email_exists = []
        for email in Registration.objects.all().values_list('email', flat=True):
            check_if_email_exists.append(email)
        if data in check_if_email_exists:
            return JsonResponse('Email already provided', safe=False, status=200)
        else:
            new_user = Registration.objects.create(email=data)
            new_user.save()
            content = {'code': new_user.code}
            send_mail(
                "Thanks for Registering",
                f'Here is your signup Token:{content}',
                'djangod192@gmail.com',
                [data],
                fail_silently=False,
            )
        return JsonResponse(content, status=201)
const SignUpStep1 = () => {
const navigate = useNavigate();
const [email,setEmail] = useState("");
const dispatch = useDispatch();
const url = "https://motion.propulsion-learn.ch/app/api/auth/registration/";

const updateEmail = (event) => {
    setEmail(event.target.value);
}
const sendVerificationCode = (event) => {
    event.preventDefault();
    if (email.length > 0) {
    const data = {
        email: email
    };
    const fetchConfig = {
        method: 'POST',
        headers: new Headers({
            "Content-Type": "application/json",
        }),
        body: JSON.stringify(data),
    };
    fetch(url,fetchConfig)
    .then((response) => {
    return response.json();
    })
    const action = {
        type:"setEmail",
        payload:email
    };
    dispatch(action)
    navigate("/SignUpStep2")
}else{
    alert("please enter email address");
}

}
about 4 years ago · Juan Pablo Isaza
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