# HTTP replies

> Keep the body of a Generic HTTP GET or POST in a position variable and show it on a button.

A Generic HTTP GET or POST can keep the reply in a position variable. The button can show that variable, and any other control in the position can read it. PUT , PATCH , and DELETE send the request and do not store the body. Note Generic HTTP is only the example on this page. Other modules can store what an action gets back, too. Some actions have their own field for picking a position variable, like the HTTP actions here. Actions from modules built on Module API 2.2 or later can return a result, and show a Store result field instead. It can write to a position variable or to one of the button's own variables. Generic SNMP's Get OID value is one of these. Which actions can store a value depends on the module. Before you begin A Generic HTTP connection. Set Base URL on the connection when every request starts from the same address. A position variable to store the reply in. Create it on the position's Configuration tab, under Position Variables , with the type String . See Use variables in controls and expressions . Keep the reply GET and POST both end with two fields: JSON Response Data Variable lists the position variables. Pick one. If the list is empty, create the variable first. The field cannot point at a button variable. JSON Stringify Result is checked by default. The variable then receives the reply as text. Clear it to parse the body as JSON. If the body is not JSON, the text is stored anyway. The address field is URI when the connection has a Base URL , and URL when it does not. A value that already starts with http is requested as written, and the base URL is not added in front of it. This example asks a rundown server for the current segment and shows the answer on the button. Create a position variable named segment , type String . On the button's Actions tab, add the connection's GET action to Press . Enter the path in URI . With a base URL of the rundown server, that is segment . In JSON Response Data Variable , select segment . Leave JSON Stringify Result checked when the reply is text. On the Design tab, set the button text to $(position.state.segment) . Select Apply . Press the button. The reply is written to segment when the request succeeds. A failed request leaves the variable as it was. Every control in the position that uses $(position.state.segment) updates together. POST uses the same two fields. It also has Body and Content Type . For application/json , the body has to be valid JSON or the request is not sent. In a workflow or a cue list, JSON Response Data Variable shows Setting Custom Variables from actions are not supported. The reply can be stored from a button on a position, including a button in a shared section that is mounted in a position. Where to go next Button actions Understand variable scope
