zweifisch / ob-http

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

Weird behavior in variable interpolation #58

Closed nfedyashev closed 1 year ago

nfedyashev commented 1 year ago
#+NAME: valid-entry-uuid
#+BEGIN_SRC http :select .[0].id :results value
GET http://localhost:1080/api/entries
#+END_SRC

#+HEADER: :var uuid=valid-entry-uuid
#+BEGIN_SRC http :pretty
POST http://localhost:1080/api/entries/${uuid}/comments
Content-Type: application/json

{
  "content": "hello world"
}
#+END_SRC

I noticed that whenever there is something after interpolated string, like /comments) part in the example below, it is truncated in actual generated requests:

INFO request{method=POST uri=/api/entries/99a71612-d5f9-11ed-ab71-e3aecb3d55d0 version=HTTP/1.1 headers={"host": "localhost:1080", "user-agent": "curl/7.74.0", "accept": "/", "content-type": "application/json", "content-length": "29"}

nfedyashev commented 1 year ago

Duplicate of #43