Best way to create action to turn switch

If I want to turn a switch on using a action of http post,
I would like to use this action from a switch and a rule without re-defining in multiple places whats the best technique to achieve this?
I did attempt to find some way using the documentation and tutorial but couldn’t understand it enough to work it out myself

thanks

If you define an item (Switch type for example) that uses the http binding, you can use this item in your sitemap, your rules, persistence, etc.

Thanks, can I use this binding in rules?

within rules, you use the items.
The items are using the bindings.

See more here: http://docs.openhab.org/configuration/rules-dsl.html

ok I think there is a disconnect in the doco for the bindings and how to execute them

eg
Switch MyItem1 { http=">[ON:POST:http://sample.com/myitem1:on] >[OFF:POST:http://sample.com/myitem1:off]" }

how do I switch this ON , or indeed if I have three requests
ON|OFF|QUERY
ie I want to switch on or off an retrieve the current state.