curl

How can I do the equivalent cURL/mimetype code in Java?

I have this currently in PHP and was wondering what the equivalent would be in Java. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $vals[$index["CM:URL"][0]]["attributes"]["VALUE"]); header("Content-type: " . $vals[$index["CM:RESOURCEOBJECT"][0]]["attributes"]["MIMETYPE"]); $content = curl_exec($ch); curl_close($ch); Thanks! ...

PHP: can't get ignore_user_abort(TRUE) working

Hi, I have a script that has ignore_user_abort(TRUE); at the top and I call it like this $socket = curl_init("http://..."); curl_setopt($socket, CURLOPT_RETURNTRANSFER, 1); curl_setopt($socket, CURLOPT_TIMEOUT_MS, 1000); $result = curl_exec ($socket); curl_close($socket); This script does some boring work that I want to run in the ba...

Python equivalent of Curl HTTP post

I am posting to Hudson server using curl from the command line using the following-- curl -X POST -d '<run><log encoding="hexBinary">4142430A</log><result>0</result><duration>2000</duration></run>' \ http://user:pass@myhost/hudson/job/_jobName_/postBuildResult as shown in the hudson documentation..can I emulate the same thing using p...

cURL for SFTP with private key authentication

I need to upload files by SFTP from a PHP script. I think cURL is probably the way, as I have this available on the server. Has anyone got an example of how to use cURL for SFTP using identity key authentication? -- EDIT -- I've just noticed that HTTP PUT might be an alternative, but how secure it that? ...

Why PHP function `curl_exec ` should be disabled?

As you know there's some php functions to be disabled on shared hosting environments. Searching the Google, I found many lists of these functions. one of these functions is curl_exec, I can't understand why this function should be disabled? How this function could be vulnerable? ...

How to display request headers with command line curl

Command line curl can display response header by using -D option, but I want to see what request header is is sending. How can I do that? ...

Hebrew in SMS messages

Hi there, im using Voicetrading to send SMSs via a custom application ive built, english is great, but when it comes to hebrew, i get blank messages. I use this code: $ch = curl_init($smsRequest); curl_setopt($ch, CURLOPT_URL, $smsRequest); curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-Type: application/x-www-form-urlencod...

Curl to get contents of gmap co-ordinates looking very slow

I just replaced file_get_contents() to curl code as that is running very slow. But after curl too is slow. Can anyone please tell me anything wrong with my code? $myurl = "http://maps.google.com/maps/geo?q=" . urlencode($address) . "&output=xml&key=MY API KEY"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $myurl); ...

Why does curl require both .lib and .dll to work?

I just downloaded curl and managed to build a programe with it. What I don't understand is why it requires both curllib.lib and curllib.dll ? In my opinion either curllib.lib or curllib.dll should be enough, why both? Also I've searched through the source but doesn't find anywhere it uses dlopen to load curllib.dll, so why is curllib....

Using PHP & curl to post an html form that includes a file

I have a form like this: <form method="POST" action="i.php" enctype="multipart/form-data"> <input type="text" name="field1"> <input type="text" name="field2"> <input type="file" name="file"> <input type="hidden" name="MAX_FILE_SIZE" value="100000"> <input type="submit"> </form> On the page I already have: $URL = 'http://somewher...

c# - WebRequest HTTP POST with Cookie (port from curl script)

The IBM RTC RESTful api gives an example of a shell script for authenticating with the server: COOKIES=./cookies.txt USER=my_user PASSWORD=my_password HOST="https://myJazzServer:9092/jazz" curl -k -c $COOKIES "$HOST/authenticated/identity" curl -k -L -b $COOKIES -c $COOKIES -d j_username=$USER -d j_password=$PASSWORD "$HOST/authentic...

AuthSub and Blogger

I'm trying to retrieve a list of blogs of a given user. I think I've successivelly authorizated myself with all the token stuff, but when I ask for the list blog, I recieve a 302 moved temporarily. I'm using curl to send the requests. In my callback page, I upgrade the token to a session token: $header = array(); $header[] = 'GET /acco...

Website Script that will click on button every x seconds...

Is there an easy way of automating clicking on a certain button on a website? I'm trying to help someone in my company out, the guy basically stares a booking page the entire day, having to click on a single button to refresh the page. If new booking slots becomes available, then it will only be shown on the page on the page refreshes, ...

hyperlink to local or network folder in hudson

I have been using Hudson CI and am posting to it using curl as mentioned here-- http://wiki.hudson-ci.org/display/HUDSON/Monitoring+external+jobs But as they say I have to convert my raw text to hexbin format and then send. I have been able to do that and it works fine except for one place: when I have a string that is a link, say http:...

php curl - posting asp.net viewstate value

Hi guys. I have the following code to login into an external site application (asp.net app) from a local site login form (written in php): <?php $curl_connection = curl_init('www.external.com/login.aspx'); curl_setopt($curl_connection, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curl_connection, CURLOPT_USERAGENT, "Mozilla/4.0 (compatib...

Sagepay cURL data posting

can any one please let me know where i did the mistake on the below code. I have just post the transaction information to sagepay as the format suggested by sagepay. so i have used cURL to post those information. here my doubt is appears on the line number 10. please advise will i use this statement for fresh connection creation? will ...

Image uploading from Python or cURL to Tumblr?

I'm working on a project that involves uploading an image to tumblr from Python. I've had luck using Tumblr's API( http://www.tumblr.com/docs/en/api ) in doing regular text-posts, but image uploads have been giving me trouble. The error messages their server returns have been limited to just telling me that there was an "Error Uploadin...

hide header post data

I have never used Api's before. I am trying to sms enable my website. My sms provider provides a HTTP API to send messages from my website. It works well. However, its not secure. The api requires number, message, Username and password. And can be sent using post or get. There is no https support. I am currently passing the number and me...

Install cURL in CentOS

Can someone direct me on how to install cURL on a CentOS server. Preferably through WHM if it's possible to recompile PHP that way.. I am a noob in SSH and this is a production server. ...

Upload file contents using cURL

I have a script with which I POST data to a server using cURL. When I use an HTML form to POST the same data, the POST looks something like this and all is well: description=Something&name=aName&xml=wholeBiunchOfData&xslt=moreData The XML and XSLT are large and change; I would prefer to maintain them in external files. However, the ...