All Questions

444
votes
31answers
500915 views

Parsing JSON with Unix tools

I'm trying to parse JSON returned from a curl request, like so: curl 'http://twitter.com/users/username.json' | sed -e 's/[{}]/''/g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n;...
291
votes
11answers
612725 views

PHP + curl, HTTP POST sample code?

Can anyone show me how to do a php curl with an HTTP POST? I want to send data like this: username=user1, password=passuser1, gender=1 To www.domain.com I expect the curl to return a response lik...
1858
votes
24answers
1273334 views

How do I get a YouTube video thumbnail from the YouTube API?

If I have a YouTube video URL, is there any way to use PHP and cURL to get the associated thumbnail from the YouTube API?
81
votes
11answers
221456 views

How to get file_get_contents() to work with HTTPS?

I'm working on setting up credit card processing and needed to use a workaround for CURL. The following code worked fine when I was using the test server (which wasn't calling an SSL URL), but now whe...
145
votes
5answers
176282 views

Php - Debugging Curl

I'd like to see what the post fields in the request are before I send it. (For debugging purposes). The php library (class) I'm using is already made (not by me), so I'm trying to understand it. As ...
1760
votes
17answers
1692263 views

How to POST JSON data with Curl from Terminal/Commandline to Test Spring REST?

I use Ubuntu and installed Curl on it. I want to test my Spring REST application with Curl. I wrote my POST code at Java side. However, I want to test it with Curl. I am trying to post a JSON data. An...
163
votes
8answers
299100 views

How do I make a request using HTTP basic authentication with PHP curl?

I'm building a REST web service client in PHP and at the moment I'm using curl to make requests to the service. How do I use curl to make authenticated (http basic) requests? Do I have to add the hea...
56
votes
12answers
66603 views

PHP: Remote file size without downloading file

Is there a way to get the size of a remote file http://my_url/my_file.txt without downloading the file?
118
votes
6answers
205771 views

How can I find where I will be redirected using cURL?

I'm trying to make curl follow a redirect but I can't quite get it to work right. I have a string that I want to send as a GET param to a server and get the resulting URL. Example: String = Kobol...
94
votes
10answers
131655 views

ios Upload Image and Text using HTTP POST

Thanks for reading. I am new to iOS and I am trying to upload an Image and a text using multi-part form encoding in iOS. The curl equivalent is something like this: curl -F "param1=value1" -F "para...

Previous Next