ob-http icon indicating copy to clipboard operation
ob-http copied to clipboard

Is there any way to get the http status code?

Open haditim opened this issue 5 years ago • 1 comments

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

haditim avatar Dec 13 '19 10:12 haditim

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

davidshen84 avatar Jan 26 '21 23:01 davidshen84

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

nfedyashev avatar Apr 08 '23 14:04 nfedyashev

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

Sure, apologies for forgetting to close the issue.

haditim avatar Apr 09 '23 11:04 haditim