Skip to content

Instantly share code, notes, and snippets.

@neeraj9
Created February 6, 2018 05:11
Show Gist options
  • Save neeraj9/9dc4bd972749470a108b03ed8fa4bd81 to your computer and use it in GitHub Desktop.
Save neeraj9/9dc4bd972749470a108b03ed8fa4bd81 to your computer and use it in GitHub Desktop.
BeamParticle script for testing HTTP POST interface
#!/bin/sh
#
# The dynamic function (in this case with name function_name) can be tested
# via the https interface (standard interface where websocket is also exposed).
curl --insecure -X POST -H ‘content-type: application/json’ -d ‘{“msg”: “hello”}’ \
-u ‘root:root’ https://localhost:8282/post/function_name
# Alternatively, there is a fast interface which supports a minimal HTTP/1.1
# server. This is very useful for high performance although implements
# very minimal HTTP server functionality. Notice that it uses HTTP with port
# 8484 and there is no authentication required.
curl -X POST -H ‘content-type: application/json’ -d ‘{“msg”: “hello”}’ \
http://localhost:8484/post/function_name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment