Having issues with PUT request to follow a channel

I saw someplace that

The correct order of calls is:

new XMLHttpRequest
xhr.open()
xhr.onreadystatechange = …
xhr.send()