Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

231
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda