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

301
Visualizações
How do I pass the server ip address in the form parameter correctly?

I have an application written in fastapi and deployed on the ubuntu server using uvicorn and supervisor. The command uvicorn main:app --host 0.0.0.0 --port 8000 starts the application. And I have access to the application at the address

myserver_ip:8000

The application has a form that (GET) is displayed at

http://myserver_ip:8000/file/



@router.get("/file/")
async def file_receive():
    content = """
<body>
<form action = "http://0.0.0.0:8000/image/uploadfile/" enctype="multipart/form-data" method="post">
<input name="file" type="file" multiple>
<input type="submit">
</form>
</body>
    """
    return HTMLResponse(content=content)

The action parameter is http://0.0.0.0:8000/image/uploadfile/ but after the form redirect, I don't go to the page http://myserver_ip:8000/image/uploadfile/. The same result if I set action = http://localhost:8000/image/uploadfile/

of course, if I set the action variable directly = http://myserver_ip:8000/image/uploadfile/ all everything starts to work. But then there is no way to run this code on a local machine. How do I set redirect correctly?

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Why dont you use a relative url?

over 4 years ago · Santiago Trujillo Relatório
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