aaronpk / websub.rocks

Test suite and debug utilities for W3C WebSub
https://websub.rocks
Apache License 2.0
26 stars 7 forks source link

Invalid mode #16

Closed billc closed 6 years ago

billc commented 6 years ago

With the below CURL command Websub.Rocks is responding with an 'invalid mode' error. I cannot determine how I am not passing 'subscribe' correctly. I tried with or without quotes. Is the request malformed? Or, is there some erroneous subtly in Websub.rocks?

$ curl --request POST --url 'https://websub.rocks/blog/100/dtAV4vYXWvpQjYum6wXT/hub?hub.mode=subscribe&hub.topic=https%3A%2F%2Fwebsub.rocks%2Fblog%2F100%2FdtAV4vYXWvpQjYum6wXT&hub.callback=http%3A%2F%2Fwww.example.com%2F12'

$ {"error":"invalid_mode","type":"error"}
aaronpk commented 6 years ago

I think the problem is you're sending all the parameters in the query string instead of in the POST body. Try:

curl https://websub.rocks/blog/100/dtAV4vYXWvpQjYum6wXT/hub -d hub.mode=subscribe ... etc
billc commented 6 years ago

Yep. I was building the request incorrectly. Thanks for the help!