Guest User

Untitled

a guest
Jan 18th, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. URLSubmit["http://www.wolfram.com",
  2. HandlerFunctions -> <|"TaskFinished" -> Print|>]
  3.  
  4. Failure["URLSubmitFailure",
  5. Association[
  6. "MessageTemplate" :> MessageName[URLSubmit, "invak"],
  7. "MessageParameters" -> {
  8. Association["TaskFinished" -> Print]
  9. }
  10. ]
  11. ]
  12.  
  13. curl -XGET "http://elastic00.example.com:9200/test-index/_search" -H 'Content-Type: application/json' -d'
  14. {
  15. "query": {
  16. "match": {
  17. "_id": "AWDd8gqhdJ9xvhUtDICa"
  18. }
  19. }
  20. }'
  21.  
  22. RunProcess[{"curl",
  23. "-XGET", "http://elastic00.example.com:9200/test-index/_search",
  24. "-H", "Content-Type: application/json",
  25. "-d", "{"query":{"match":{"_id":"AWDd8gqhdJ9xvhUtDICa"}}}"
  26. }, "StandardOutput"]
  27.  
  28. req = HTTPRequest[
  29. URLBuild[<|
  30. "Scheme" -> "http",
  31. "Domain" -> "elastic00.example.com",
  32. "Port" -> 9200,
  33. "Path" -> {"test-index", "_search"}|>],
  34. <|
  35. "ContentType" -> "application/json",
  36. "Body" -> ExportString[{"query" -> {"match" -> {"_id" -> "AWDd8gqhdJ9xvhUtDICa"}}}, "JSON"]
  37. |>
  38. ]
  39.  
  40. URLRead[req]
  41.  
  42. Failure["InvalidLocation",
  43. Association[
  44. "MessageTemplate" -> "Specified request is invalid",
  45. "MessageParameters" -> Association[]]]
Add Comment
Please, Sign In to add comment