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

428
Views
error de lanzamiento de guzzlehttp en el proyecto laravel - strtolower (): el argumento n. ° 1 ($ cadena) debe ser de tipo cadena, int dado

Estoy tratando de consumir una API POST usando guzzlehttp en mi proyecto laravel. Pero recibo un error en mi servidor de desarrollo. Esto funciona perfectamente en mi sistema local. $postArray está manipulando correctamente ambos lados. Esta es mi versión de compositor. "guzzlehttp/guzzle": "^7.3", Si alguien sabe sobre esto, por favor ayúdeme.

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

strtolower(): El argumento #1 ($string) debe ser de tipo string, int dado

 { "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

Enfrenté el mismo problema, y cuando busqué, llegué a esta página.
Así es como lo resolví.

 $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!