Why does Guzzle put an underscore in my url!?
Joe • May 25, 2017
day job php today i learned"Why does Guzzle put an underscore in my url!?"
This was an issue I agonized over for more time than I'm willing to admit. I was parsing URLs out of an Apache access log to gather real world usage to run against my test server for the day job. I was having the issue when I read the URL from the file and passed the URL to Guzzle that Guzzle would append an underscore to every URL, causing it to 404.
The problem is that I wasn't trimming the whitespace from the URL and Guzzle turns whitespace into underscores. I really hope someone who ends up searching the same thing finds this so it helps them not spend hours chasing this down.
Today I learned, and I feel dumb because it took me so long to realize.
As Seen On
Recent Posts
- PHP to Rust via Copilot
- Compiling Python 3.12 from Source Tarball on Linux
- HTML Form Processing with PHP - php[architect] Magazine August 2014
- The Workshop: Local Dev with Lando - php[architect] Magazine November 2022
- Getting back into the swing of things
- All Posts
Categories
- ansible
- apache
- applesilicon
- aws
- blackwidow
- cakephp
- community
- composer
- conferences
- copilot
- data-storage
- day-job
- devops
- docker
- fpv
- general
- github
- givecamp
- homestead
- jigsaw
- joindin
- keyboard
- laravel
- learning
- linux
- maker
- mamp
- mentoring
- music
- nonprofit
- opensource
- packages
- php
- phparch
- projects
- provisioning
- python
- razer
- rust
- s3
- security
- slimphp
- speaking
- static-sites
- storage
- testing
- tiny-whoop
- today-i-learned
- training
- ubuntu
- vagrant
- version-control
- windows
- writing
- wsl
- wsl2
- zend-zray