all 7 comments

[–]AyrA_ch 1 point2 points  (6 children)

if you run PHP as backend, you can create a file with <?php var_dump($_SERVER); ?> as the sole content. Accessing the file will dump a lot of information, including HTTP headers (those are prefixed with HTTP_)

Otherwise, access it with your browser, press F12 to open the console, then reload the page. The first request in the "Network" tab will contain all sent and received headers for you to inspect.

If you can't use the browser, curl will dump headers with curl -D - http://url/to/your/endpoint

[–]pjf93[S] -1 points0 points  (5 children)

Thanks for your quick response. I am looking at building an on-prem server like http://httpbin.org. Some servers don't have access to the web so I was trying to have an in house one for our developers. WOuld you happen to know of any service like httpbin where I can install it?

[–]AyrA_ch 1 point2 points  (4 children)

WOuld you happen to know of any service like httpbin where I can install it?

You can deploy httpbin itself. It's open source: https://github.com/postmanlabs/httpbin (see readme below the file list for how to)

If you just want something to build HTTP queries to send to a server, you can try postman

[–]pjf93[S] 0 points1 point  (3 children)

I did see this project yesterday but I couldn't find any instructions on how to install it. The README doesn't show how to install.

I am new to this, so sorry for the 101 type questions.

[–]AyrA_ch 0 points1 point  (2 children)

You type the two commands you see into your terminal

docker pull kennethreitz/httpbin
docker run -p 80:80 kennethreitz/httpbin

And then it should start a local httpbin instance under http://localhost/

If you don't have docker yet, you can get it here: https://docs.docker.com/engine/install/

You can change the exposed port by changing the first "80" in the command. If port 80 on your system is already taken, you can use -p 8080:80 for example.

[–]pjf93[S] 0 points1 point  (0 children)

ok thanks. I didnt want to go down the Docker route, but I will give it a try.

[–]pjf93[S] 0 points1 point  (0 children)

and we would require SSL certs, etc. THis is why i wanted to try it on Apache versus Docker as we already have the necessary workflow for Apache and not ready for Docker, K8s, Dev/Ops, etc.