Hmm, I just ran the following two curl commands with iOS 1.3.0 build 50 and 
SG 1.3.0 build 247.

*Create replication*

curl -H 'Content-Type: application/json' -vX POST 
'http://localhost:5984/_replicate' \

                                  -d 
'{"source":"untitledapp","target":{"headers":{"Cookie":"SyncGatewaySession=964dfd92221ae028c13710ab83cf4d6742ef225d;
 
Path=/sync_gateway; 
Expires=2016-08-04T12:02:41.883045272+01:00"},"url":"http://localhost:4984/sync_gateway"},"continuous":true}'

*Stop replication*

curl -H 'Content-Type: application/json' -vX POST 
'http://localhost:5984/_replicate' \
                                  -d 
'{"source":"untitledapp","target":{"headers":{"Cookie":"SyncGatewaySession=964dfd92221ae028c13710ab83cf4d6742ef225d;
 
Path=/sync_gateway; 
Expires=2016-08-04T12:02:41.883045272+01:00"},"url":"http://localhost:4984/sync_gateway"},"continuous":true,
 
"cancel": true}'

The response from the second request is:

{"ok":true}

Which builds of 1.3 of are you running?

James

On Wednesday, 3 August 2016 11:52:22 UTC+1, Nick Pomfret wrote:
>
> Thanks for the reply.  These are the 2 calls to _replicate that start the 
> replication tasks (sorry for the formatting):
>
> "*{\"source\":\"pc_macmini_0_c5149e0b-d6a6-4d7c-9498-ed311552c663\",\"target\":{\"headers\":{\"Cookie\":\"SyncGatewaySession=a066bb06b86bca4c71d98a8eea69ae4f3a9de400;
>  
> Path=/sync_gateway; Expires=Thu, 04 Aug 2016 10:43:41 
> GMT\"},\"url\":\"http://192.168.1.185:4984/sync_gateway\ 
> <http://192.168.1.185:4984/sync_gateway%5C>"},\"continuous\":true}*"
>
> "*{\"source\":{\"headers\":{\"Cookie\":\"SyncGatewaySession=a066bb06b86bca4c71d98a8eea69ae4f3a9de400;
>  
> Path=/sync_gateway; Expires=Thu, 04 Aug 2016 10:43:41 
> GMT\"},\"url\":\"http://192.168.1.185:4986/sync_gateway\ 
> <http://192.168.1.185:4986/sync_gateway%5C>"},\"target\":\"pc_macmini_0_c5149e0b-d6a6-4d7c-9498-ed311552c663\",\"continuous\":true}*
> "
>
> And these are the 2 calls that are supposed to stop them.  They work on 
> android 1.3x, but not on iOS - they both result in a 404.
>
> "*{\"source\":{\"headers\":{\"Cookie\":\"SyncGatewaySession=a066bb06b86bca4c71d98a8eea69ae4f3a9de400;
>  
> Path=/sync_gateway; Expires=Thu, 04 Aug 2016 10:43:41 
> GMT\"},\"url\":\"http://192.168.1.185:4986/sync_gateway\ 
> <http://192.168.1.185:4986/sync_gateway%5C>"},\"target\":\"pc_macmini_0_c5149e0b-d6a6-4d7c-9498-ed311552c663\",\"continuous\":true,\"cancel\":true}*
> "
>
> "*{\"source\":\"pc_macmini_0_c5149e0b-d6a6-4d7c-9498-ed311552c663\",\"target\":{\"headers\":{\"Cookie\":\"SyncGatewaySession=a066bb06b86bca4c71d98a8eea69ae4f3a9de400;
>  
> Path=/sync_gateway; Expires=Thu, 04 Aug 2016 10:43:41 
> GMT\"},\"url\":\"http://192.168.1.185:4984/sync_gateway\ 
> <http://192.168.1.185:4984/sync_gateway%5C>"},\"continuous\":true,\"cancel\":true}*
> "
>  
>
>
> /**
>  * [email protected] <javascript:>
>  * http://twitter.com/nickpomfret
>  * https://uk.linkedin.com/in/nick-pomfret-03614a
>  */
>  
>
> On 3 August 2016 at 10:05, James Nocentini <[email protected] 
> <javascript:>> wrote:
>
>> The *cancel: true *field must be passed along with all the other 
>> properties that were specified when the replication was created (i.e. 
>> source, target, continuous etc.)
>>
>> It's documented here 
>> http://developer.couchbase.com/mobile/swagger/couchbase-lite/#!/server/post_replicate
>>  
>> and 
>> http://developer.couchbase.com/documentation/mobile/1.2/develop/references/couchbase-lite/rest-api/server/post-replicate/index.html
>>  
>> <http://www.google.com/url?q=http%3A%2F%2Fdeveloper.couchbase.com%2Fdocumentation%2Fmobile%2F1.2%2Fdevelop%2Freferences%2Fcouchbase-lite%2Frest-api%2Fserver%2Fpost-replicate%2Findex.html&sa=D&sntz=1&usg=AFQjCNEWykkIMylowdAq_ajsJ7rdzMCn6Q>
>> .
>>
>> Can you share the payload of the POST /_replicate request?
>>
>> James
>>
>> On Wednesday, 3 August 2016 06:45:25 UTC+1, Nick Pomfret wrote:
>>>
>>> I'm trying to cancel a replication task VIA the REST API.  Its not 
>>> documented as far as I can see, but I gather (
>>> http://docs.couchdb.org/en/stable/api/server/common.html#post--_replicate) 
>>> that I'm supposed to call the `_replicate` endpoint with the same arguments 
>>> that I used to create the task, but adding a `cancel: true` parameter.  It 
>>> works on Android 1.3x but not on iOS 1.3x, and I'm pretty sure that I it 
>>> used to work on 1.2 in iOS (but can't be sure).
>>>
>>> Or have I misunderstood, is there another way?
>>>
>>>
>>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "Couchbase Mobile" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/mobile-couchbase/8y3eMdlHtpM/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/mobile-couchbase/40f96fa0-bf0e-4758-ab28-7fb12b9cc7d9%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/mobile-couchbase/40f96fa0-bf0e-4758-ab28-7fb12b9cc7d9%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/mobile-couchbase/d172ed72-7c1b-4487-b714-eecdecf06a9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to