The integration of wireless sensor networks within the Internet has been possible with the use of the IPv6 over lowpower wireless personal area network standard at lower layers and Web services at higher layers. The operating constraints of wireless sensor networks and the implementation of traditional Internet protocols in these networks require an efficient adaptation of specialized low-power application protocols. Under this scope, this article presents the design, implementation, and evaluation of a secure, lightweight, and energy-efficient application protocol based on binary encoding and a RESTful approach to enable Web services in wireless sensor networks. The lightweight and secure protocol for wireless sensor network protocol has been designed to work over transmission control protocol, and it is recommended for applications where strong reliability constraints are imposed or in the configuration, reprogramming, or management of sensor nodes. Results show that lightweight and secure protocol for wireless sensor network is energy efficient regardless the use of legacy transmission control protocol as transport protocol, which brings the possibility of interoperability with existing systems, Internet protocols, and network infrastructure. We believe that lightweight and secure protocol for wireless sensor network will allow the expansion of the Internet of Things at a global scale.