background preloader

cURL - Tutorial

cURL - Tutorial
cURL Docs Tutorial HTTP Scripting 1.1 Background1.2 The HTTP Protocol1.3 See the Protocol1.4 See the Timing1.5 See the Response 2.1 Spec2.2 Host2.3 Port number2.4 User name and password2.5 Path part Fetch a page HTML forms 4.1 Forms explained4.2 GET4.3 POST4.4 File Upload POST4.5 Hidden Fields4.6 Figure Out What A POST Looks Like HTTP upload HTTP Authentication 6.1 Basic Authentication6.2 Other Authentication6.3 Proxy Authentication6.4 Hiding credentials More HTTP Headers 7.1 Referer7.2 User Agent Redirects 8.1 Location header8.2 Other redirects Cookies 9.1 Cookie Basics9.2 Cookie options 10.1 HTTPS is HTTP secure10.2 Certificates Custom Request Elements 11.1 Modify method and headers11.2 More on changed methods Web Login 12.1 Some login tricks Debug 13.1 Some debug tricks References 14.1 Standards14.2 Sites 1. 1.1 Background This document assumes that you're familiar with HTML and general networking. Curl is not written to do everything for you. 1.2 The HTTP Protocol The client, curl, sends a HTTP request. or 3.

HTTPBuilder In working with a RESTful web service that allows PUT requests to upload files, I came across an slight annoyance with the put() convenience method in the Groovy RESTClient. Up until now, I've been absolutely amazed with how easy RESTClient makes my life in working with RESTful web services, and I'll continue to use it in doing REST development. However, in this one case, RESTClient wouldn't work nicely for me. Here's the scenario: I upload a zip file to the service so that it can use the data in that file to populate some things (see my post Groovy, RESTClient, and PUTting zip files for one way to get RESTClient to handle zip files). Here's what the Groovy code looked like at this point: It turns out that the RESTful service, once it gets the file, just sends back an HTTP "201 Created" response code. Since I didn't see a way of telling RESTClient not to expect a response body, I could have just lived with the exception, catching it and moving along.

MacPorts Guide cURL and libcurl how to survive in vi and emacs some basic vi commands. :set nu show line numbers. :set ic ignore case differences when searching. :set ai set automatic indent. :set sm show matching ( or { with ) or } in insert mode. down-arrow up-arrow move down/up 1 line. right-arrow left-arrow move right/left 1 character column. 0 $ go to 1st/last column of current line. return go down to 1st printable character of next line. nw nb move right/left n words (1 word if n omitted). ng go to line n (end of file if n omitted). ctrl-f ctrl-b page forward/backward 1 screen. ctrl-d ctrl-u page forward/backward half a screen. [[ ]] go to beginning of current/next c function. emacs survival guide. emacs has a vast range of commands, this is just a very brief personal selection of the ones i use most often.

Swiss Army Knives: cURL & tidy « Gnip Blog Iterating quickly is what makes modern software initiatives work, and the mantra applies to everything in the stack. From planning your work, to builds, things have to move fast, and feedback loops need to be short and sweet. In the realm of REST[-like] API integration, writing an application to visually validate the API you’re interacting with is overkill. cURL can generate custom HTTP client requests with any HTTP method you’d like. POSTing Some APIs want data POSTed to them. Inline curl -v -d "some=data" " From File curl -v -d @filename " In either case, cURL defaults the content-type to the ubiquitous “application/x-www-form-urlencoded”. curl -v -d "someotherkindofdata" " --header "Content-Type: foo" Authentication Passing HTTP-basic authentication credentials along is easy. curl -v -uUSERNAME[:PASSWORD] " Show Me Everything You’ll notice I’m using the “-v” option on all of my requests.

Tutorial completo do apt-get No começo existia o código fonte. Você baixava um pacote .tar.gz, contendo o código fonte do programa, e a instalação consistia em compilar e instalar os executáveis gerados na sua máquina. Esta forma de distribuição faz sentido em se tratando de aplicativos abertos, pois permite que você veja e até adapte o código fonte se necessário, para que ele rode na sua máquina. Em muitos casos, é possível instalar o programa em outro sistema operacional (a maior parte dos programas do Linux podem ser instalados no BSD, com pequenas adaptações) ou até mesmo em outras plataformas. O problema é que instalar programas a partir dos fontes é demorado e nem sempre simples, já que você precisa ter instalados uma grande quantidade de compiladores e bibliotecas, necessários para compilar os mais diversos programas. Compilar significa transformar o código fonte, escrito pelo programador, nos arquivos binários que são executados pelo sistema. Os pacotes são uma idéia muito simples. # apt-get update

Best Linux Software You’ve made the switch from Windows or Mac OS X, and now you’re looking for applications to install. Or maybe you’re a long-time Linux user who’s keeping an eye out for what’s new. Either way, you’ve come to the right place. You’ve already picked a Linux distro and have settled on a desktop environment. Those are the big choices that determine what software you start with and what will run best on your machine. Most of the software below is free and open source. A few require you to download an installer from a website. Browsers Firefox With the new Quantum update, Mozilla has given people reason to check out Firefox again. 9 Reasons to Switch From Chrome to Firefox 9 Reasons to Switch From Chrome to Firefox The days when Chrome was the best browser are long gone. Chrome/Chromium By some measures, Chrome is now the king of the hill. How to Decide If a Chromebook Is Right For You How to Decide If a Chromebook Is Right For You Is a Chromebook for everyone? Opera Web (Epiphany) Browser QupZilla

Related: