Enable/disabling projections over HTTP API

Hi there,

I seem to be having problems enabling and disabling projections using the http api with curl. It’s probably just my curl ignorance but running this for example:

curl -i http://127.0.0.1:2113/projection/$streams/command/enable

returns a 404 not found

Can anyone shed any light?

Cheers

You shouldn’t be bookmarking those Uris in general. I know it’s on a branch now but not sure if on trunk there is a link from the status uri to cancel. I’ll check later today (it’s def on projections branch)

You shouldn’t be bookmarking those Uris in general. I know it’s on a branch now but not sure if on trunk there is a link from the status uri to cancel.

Also a command such as enable/disable should be a post you have a get

I was always using the same curl request for enabling the by-type projection within my puppet automated setup. However for whatever reasons the same command does not work anymore.
I am using v3.0.3 under Linux. Here is the verbose output from curl:

vagrant@event-store:~$ curl -X POST --user admin:changeit ‘http://localhost:2113/projection/$by_event_type/command/enable’ -v

  • Hostname was NOT found in DNS cache
  • Trying 127.0.0.1…
  • Connected to localhost (127.0.0.1) port 2113 (#0)
  • Server auth using Basic with user ‘admin’

POST /projection/$by_event_type/command/enable HTTP/1.1
Authorization: Basic YWRtaW46Y2hhbmdlaXQ=
User-Agent: curl/7.35.0
Host: localhost:2113
Accept: /

< HTTP/1.1 411 Length Required
< Content-Type: text/html; charset=us-ascii

  • Server Mono-HTTPAPI/1.0 is not blacklisted
    < Server: Mono-HTTPAPI/1.0
    < Date: Mon, 20 Apr 2015 19:24:47 GMT
    < Content-Length: 24
    < Connection: close
    <
  • Closing connection 0

``

For future readers, just send an empty string as request body, worked for me.
Just add ’ --data “” ’ to the curl invocation.