Http POST method

Is there a way to use POST with a!httpquery() ? I don't see the POST option under method. I do see in the http query smart service that it contains a value of POST under method. Has anyone been successful in using this or can guide me in the right direction. Thanks. 

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer
    Hi a!httpquery() is meant for servicing GET specific calls only. You can use a!httpwrite() function to invoke POST call and send the data through Body.

    But if you are working with Appian 17.x version, they have introduced Integration object, which is quick to configure and execute. But if you are working with lower version of Appian then in such case you can go for a!httpwrite()

    But httpwrite() or Integration object must be executed on saveInto by the use of bind() on load, for example within interface.

    But if you want to execute POST call using process model node such as Script Task, then you can go for HTTP Query Smart Service, where method will be set to POST


    Hope this will help you.
  • Thanks for the help. I was able to get the POST working the HTTP Query Smart Service. I do have some questions though. I didn't input any values for Headers and Parameters. 1) what exactly are those fields for? 2) what is the purpose of bind() when using httpwrite()?
Reply Children
  • 0
    Certified Lead Developer
    in reply to xingc
    Hi xingc,

    When you use HTTP Query Smart Service to communicate with another system, you are actually making a HTTP Transaction in the background which contains a Request and a Response.

    To put it simply, Headers are nothing key value pairs which gives information about the data that you are sending in the request(or the data that you are receiving in the response). For example, the most commonly used header field, "Content-Type", tells about the type of the data(XML/Json/Text/etc.,) that you are sending in the Request(or receiving in the Response).

    a!httpWrite() returns the Writer and that is why it should be used with the bind() function. Because bind() lets you bind a getter and setter rule or function to a variable such that when that variable is read, the getter method is called and when it is saved into, the writer returned by the setter method is called. Please go through the below link for further information.

    docs.appian.com/.../fnc_evaluation_bind.html

    Hope this answers your questions.

    Thank you,
    Arun