http --pretty=none https://www.cueup.com/jobs User-Agent:curl
(`--pretty=none` is needed because the server incorrectly sends `Content-Type: text/html`)1,606 karma · joined February 4, 2011
http --pretty=none https://www.cueup.com/jobs User-Agent:curl
(`--pretty=none` is needed because the server incorrectly sends `Content-Type: text/html`)Any hints on how to solve these incompatibilities between HTTPie and Requests v1.0 appreciated: https://github.com/jkbr/httpie/issues/113.
A small thing: For cancelled DELETE requests like shown in the video, it would be better to return 403 Forbidden [1] instead of 400 Bad Request [2]:
10.4.1 400 Bad Request
The request could not be understood by the server due to malformed syntax.
Vs. 10.4.4 403 Forbidden
The server understood the request, but is refusing to fulfill it.
[1] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10...[2] http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10...
def add1(arr, val, n):
todo = abs(n) or len(arr)
seq = xrange(0, len(arr), 1) if n >= 0 else xrange(len(arr) - 1, 0, -1)
for i in seq:
if arr[i] == val:
arr[i] += 1
todo -= 1
if not todo:
break
return arr # Finder: allow text selection in Quick Look
defaults write com.apple.finder QLEnableTextSelection -bool true
Combined with "Use OSX Finder Quicklook (Spacebar) to preview all plain text files"[1] is pretty useful.What I dislike about this particular implementation is the UI: You don't know what happens when you click the button until you have actually clicked it (the same problem has for example the 'kudos' widget on Svbtle[0]). Also the button is slightly obtrusive. Something more subtle with an explanation on hover or a confirmation dialog would IMO do a better job.
A good example of something similar is (the now obsolete) Django Book[1] where people can comment on any paragraph.
[0] e.g. http://500hats.com/late-bloomer/
Good point, I'll add it to the README.
> Is there a way to have it construct the query string [...]
Not yet, but it's being already discussed here:
echo '{"foo": "bar"}' | http url
The reason for having the simplified one is that it's less verbose and usually doesn't even require you to quote it: http url foo=barI tried to come up with syntax that would make the most common tasks (i.e., sending JSON objects, submitting forms, setting headers, etc) as easy as possible and also feel "natural". The reason for the chosen style is that it quite corresponds to the actual HTTP request being sent. For example, if you want to send a PATCH request with a custom header and a form field data:
PATCH /patch HTTP/1.1
X-API-Token: 123
Host: httpbin.org
Content-Type: application/x-www-form-urlencoded; charset=utf-8
foo=bar
You can simply copy the header (X-API-Token: 123) and the data (foo=bar) and paste it to the terminal: http --form PATCH httpbin.org/post X-API-Token:123 foo=bar
It's not as obvious as '--request PATCH --header X-API-Token:123 --form foo=bar', but on the other hand, the command doesn't include almost anything that wouldn't become part of the actual request, which makes it short and easy to focus on what's important.If you are sending complex JSON, it's probably stored in a file or it's the output of another program:
http PUT httpbin.org/put @/data/test.json
http -b localhost:8888/couchdb/ | http PUT httpbin.org/put Source: Freebase, licensed under CC-BY
Other content from Wikipedia, licensed under CC BY-SA> Downloading this package will install copies of the core command line tools and system headers into system folders, including the LLVM compiler, linker, and build tools.
POST /orders?action=sum&field=price HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/json
{"sum": 9000}
Or actions with side effects: POST /orders?action=process-queue HTTP/1.1
HTTP/1.1 204 No Content
Which is better than creating a specific resource for each of the "actions", such as /orders_sum_price or /orders_process_queue, because it keeps the URIs clean.Btw, Django 1.4 (now alpha) is getting timezone support [1] and its django.utils.timezones [2] features similar functionaliy.
[1] https://docs.djangoproject.com/en/dev/topics/i18n/timezones/...
[2] https://github.com/django/django/blob/master/django/utils/ti...
Countless. Django prefers configuration over convention. I think it's because there is too much focus on the reusable apps concept. It would be great if it was a little bit the other way around.