Cancel friendship request


Hi all,

Can someone tell me how i can cancel a friendship request.
When you want to follow someone on Twitter, you sometimes see the message Pending, and when you hover this button you can cancel it.
I would like to know how we can do this through the REST API.

On a forum they talked about using the friendships/cancel method, but when i try that i get the message Not authorized to use this endpoint (error code 37).

Thanks in advance.