Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to update hook source using the API #240

Closed
pyhedgehog opened this issue May 23, 2016 · 3 comments
Closed

How to update hook source using the API #240

pyhedgehog opened this issue May 23, 2016 · 3 comments

Comments

@pyhedgehog
Copy link

I've found #221, but instruction there doesn't works:

C:\src\tests>cat hookupdate.js
var sdk = require("hook.io-sdk");

var client = sdk.createClient({});

client.hook.update('testeb43df31_2329bb48hook', { "source": 'print(globals())', "language": "python" }, function (err, res) {
  console.log(err, res)
});
C:\src\tests>node hookupdate.js
{ Error: socket hang up
    at createHangUpError (_http_client.js:250:15)
    at TLSSocket.socketOnEnd (_http_client.js:342:23)
    at emitNone (events.js:91:20)
    at TLSSocket.emit (events.js:185:7)
    at endReadableNT (_stream_readable.js:926:12)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9) code: 'ECONNRESET' } undefined

I've tried to do this with curl with same results:

$ curl -i -H "hookio-private-key: $hook_private_key" -H 'accept: application/json' --data 'source=print(globals())&owner=pythonsdktest&name=testeb43df31_2329bb48hook&language=python&save=save' 'https://hook.io/admin'
curl: (52) Empty reply from server
$ curl -i -H "hookio-private-key: $hook_private_key" -H 'accept: application/json' -H 'content-type: application/json' --data-raw '{"source":"print(globals())","owner":"pythonsdktest","name":"testeb43df31_2329bb48hook","language":"python","save":"save"}' 'https://hook.io/admin'
curl: (52) Empty reply from server
@chriskruse
Copy link

Any patch for this issue?

@Marak
Copy link
Collaborator

Marak commented Jul 28, 2016

Checking today.

Will have an update shortly.

@Marak
Copy link
Collaborator

Marak commented Aug 25, 2016

This should be hot-patched on production, was a one-line fix.

Commits coming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants