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

434
Visualizações
guzzlehttp throwing error on laravel project - strtolower(): Argument #1 ($string) must be of type string, int given

I am trying to consume one POST api using guzzlehttp In my laravel project. But i am getting one error on my dev server. This working perfectly on my local system. $postArray is manipulating correctly both side. This is my composer version. "guzzlehttp/guzzle": "^7.3", If any one know about this please help me out.

     $response = Http::withHeaders([
            "accept: application/json",
            "content-type: application/json"
        ])->post('https://staging.consume.com/testing', $postArray)->json();

strtolower(): Argument #1 ($string) must be of type string, int given

    {
"message": "strtolower(): Argument #1 ($string) must be of type string, int given",
"exception": "TypeError",
"file": "/mnt/drive_1/www/deploy-api-2021-07-29-14-25-12/vendor/guzzlehttp/psr7/src/Utils.php",
"line": 28,
"trace": [
    {
        "file": "/mnt/drive_1/www/deploy-api-2021-07-29-14-25-12/vendor/guzzlehttp/psr7/src/Utils.php",
        "line": 28,
        "function": "strtolower"
    },
    {
        "file": "/mnt/drive_1/www/deploy-api-2021-07-29-14-25-12/vendor/guzzlehttp/psr7/src/Utils.php",
        "line": 189,
        "function": "caselessRemove",
        "class": "GuzzleHttp\\Psr7\\Utils",
        "type": "::"
    },
    {
        "file": "/mnt/drive_1/www/deploy-api-2021-07-29-14-25-12/vendor/guzzlehttp/guzzle/src/Client.php",
        "line": 455,
        "function": "modifyRequest",
        "class": "GuzzleHttp\\Psr7\\Utils",
        "type": "::"
    },
over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I faced the same problem, and when I searched, I arrived at this page.
Here's how I solved it.

     $response = Http::withHeaders([
            "accept" => "application/json",
            "content-type" => "application/json"
        ])->post('https://staging.consume.com/testing', $postArray)->json();
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