I am using the TripIt.com API for a project but I am totally confused about how to convert this CURL command to Java.
$ curl -k -D /dev/tty --data-urlencode xml@/var/tmp/trip.xml --user <username>:<password> https://api.tripit.com/v1/create
HTTP/1.1 200 OK
Server: nginx/0.6.32
Date: Fri, 05 Dec 2008 22:12:35 GMT
Content-Type: text/xml; charset=utf-8
Transfer-Encoding: chunked
Connection: keep-alive
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
I know I have to use URLConnection, but don't know how to set other values. Like username, password, path to the XML file etc...
How should I do that?