Skip to main content

Design Component Data

Component data is designed based on the functions provided by your component. Our example will implement user creation, query and modification.Each user has two data fields: name and age.

Initialization Method Data Type

Initialize the methods you provide in the constructor. We initialize three request methods: GET request:
getUser, obtains the user’s name and age.
POST request:
createUser, creates a user.
PUT request:
updateUserName, updates the user’s name.
Function used to set method.

Implement Request Methods

Implement each request method in GET, POST, and PUT.
Function used to compares two strings for equality.

Put them together

Example.sol