zweifisch / ob-http

make http request within org-mode babel
GNU General Public License v3.0
256 stars 30 forks source link

Is there any way to get the http status code? #47

Closed haditim closed 1 year ago

haditim commented 4 years ago

Hello and thanks for the amazing project. I do not seem to be able to get the HTTP status code from the request in the results. Am I missing something? I use it this way:

#+BEGIN_SRC http :pretty :var auth_token=token_req :var uuid=storage
GET /storage/${uuid}
content-Type: application/json
Authorization: Bearer ${auth_token}

#+END_SRC

#+RESULTS:
#+begin_example
[
  {
    "id": "becb15e1-e70a-43ed-946e-90551a1eadf4",
    "name": "test from Hadi",
    "projects": [
      "7f3d3f48-74f3-40b1-872e-475814b4173e"
    ],
  }
]
#+end_example
davidshen84 commented 3 years ago

Remove the :pretty option and it will return the HTTP headers in the buffer.

nfedyashev commented 1 year ago

@haditim I suggest closing this issue because David explained it. WDYT?

haditim commented 1 year ago

@haditim I suggest closing this issue because David explained it. WDYT?

Sure, apologies for forgetting to close the issue.