Skip to content

Keep trailing newlines in POST request #52

@geolessel

Description

@geolessel

Hi and thanks for the great package!

I've been using org-mode and ob-http to learn Elasticsearch. One of the endpoints allows a submission of Content-Type: application/x-ndjson and requires an final newline in the request body. However, no matter how many newlines I enter into the source block, I keep getting the same error that it needs a trailing newline. It would be great to have an option to retain trailing newlines (or at least add one on execution).

An example of one of my requests:

#+begin_src http
  POST ${host}/_bulk
  Content-Type: application/x-ndjson

  {"create": {"_index": "products", "_id": 201}}
  {"name": "Milk Frother", "price": 149, "in_stock": 14}

  


  
#+end_src

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions