go run visiongotest.go
go build visiongotest.go
Method: GET
Params | Type | Description | Example |
---|---|---|---|
val | integer | Searching value | 36 |
Example:
curl --request GET --url 'http://localhost:8080/search?val=36'
Output:
{
"Found": true,
"Tree": {
"Value": 36,
"Left": {
"Value": 34,
"Left": {
"Value": 32,
"Left": null,
"Right": null
},
"Right": null
},
"Right": null
}
}
Method: DELETE
Params | Type | Example |
---|---|---|
val | integer | 412 |
Example:
curl --request DELETE --url 'http://localhost:8080/delete?val=412'
Output:
{
"Deleted": [
412
],
"Tree": ... Full tree
Method: POST
Content-Type: application/json
Body: int[]
Example:
curl --request POST \
--url http://localhost:8080/insert \
--header 'content-type: application/json' \
--data '[2]'
Output:
{
"Inserted": [
2
],
"Tree": ... Full tree