How to use PHP curl and curl_setopt with JSON web services

Here are two PHP scripts I just wrote that use curl and curl_setopt. The first example makes a GET request, and the second example makes a POST request, and passes JSON data to the web service it accesses.

A PHP curl GET request

This first one makes an HTTP GET request and prints the data that is returned by the URL that it hits:

Android internet access error - Unable to resolve host

Android FAQ: “Help, I'm getting an internet access error with my Android application that says, " Unable to resolve host (hostname): No address associated with hostname". I think my HTTP/REST code is correct, what's wrong?”

If you get an error message like this:

'Why is my Mac slow?' - How to debug Mac (some) networking problems

A lot of times when I'm asked to debug a Unix, Linux, or Mac OS X system, I'll hear a complaint like "The network seems slow", or just "It seems slow", followed by the usual "What is it doing?"

I actually think that last question is a wonderful one: What is this computer doing?

You can see a lot of information about Unix processes using the ps command or the top utility, but it seems like many system administrators don't know how to find networking information, at least not without a network sniffer.

The "freemium" business model - best practices

It's so rare that a CEO talks in detail about how their company generates revenue that I want to take a moment and share this TechCrunch link, which covers Evernote CEO Phil Libin's presentation at a meeting named Founder Showcase. Mr. Libin discussed some of the elements of making the "freemium" business model work.

RockMelt browser review

RockMelt browser review - I'll probably be off this "social web browser" kick soon, but at the moment, it's a very intriguing playing field. As I wrote in my earlier Mac social web browsers review, even in a beta status, I think the new RockMelt browser is the current king of social web browsers.

RockMelt browser review - The short story

If you're interested in going down the social web browser road, here's what's good about RockMelt:

My web browser privacy tips alvin November 3, 2010 - 1:59pm

Web browser privacy FAQ: Can you share some internet/web browser privacy tips? (i.e., What can I do to improve my web browser privacy and security?)

With the latest Adobe Flash security snafu (see my uninstall Mac Flash article), I'm again reminded of the topic of internet web browser privacy and security. I've written about browser privacy before, but this time I thought I'd take a different tact and share the things I know and do to help have a modicum of web browser privacy.

Better web browser privacy with Better Privacy

Web browser privacy FAQ: What things can I do to improve my internet/web browser privacy and security (especially in regards to "Flash cookies", or "Flash super cookies")?

Continuing my research into internet/web browser privacy, I've already mentioned that I stumbled onto the "Better Privacy" Firefox plugin, but I haven't written much specifically about it. So, here's what I know about web browser privacy and Better Privacy.