Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

433
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!