Ad Widget

Collapse

WebScenario POST json data

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muelli
    Member
    • Jun 2021
    • 68

    #1

    WebScenario POST json data

    Hello forum,

    I have a web scenario where I need to post JSON data.
    The manual curl is very easy for that:

    curl -X POST -H "Content-Type:application/json" -H "Authorization:Basic <API KEY>" -d "{'MSGSource':'Zabbix','Action':'ping'}" http://www.example.net/API

    However I seem to be too stupid to transform this into a web scenario. I added a the two headers:
    Content-Type => application/json
    Authorization => Basix <API KEY>

    And in the first and only step, I entered the json data as "Raw data" in post type like in curl:

    {'MSGSource':'Zabbix','Action':'ping'}

    However I only get an HTTP 400 error code.

    Any advice or hints? Thanks!
  • muelli
    Member
    • Jun 2021
    • 68

    #2
    Suddenly it works, for whatever reason.
    Sorry can be closed

    Comment

    • xtj
      Junior Member
      • Apr 2024
      • 5

      #3
      Hello Mueli .CanYou write little more about Your scenario ? What You exactly want to get and from where You send json body ? You create some script ? I have simillar problem when I send json body by post method from bash script using Scripts in Administration . I get response timeout. I try to find some fix in my case.

      Comment

      Working...