Hi Actually This happens on BAM 2.5.0. Not 2.4.1. In 2.4.1 datareceiver API is working fine.
Thanks, Nuwanw On Tue, Mar 3, 2015 at 11:08 PM, Nuwan Wimalasekara <[email protected]> wrote: > Hi > I just need to define a stream and publish the event to the created stream > using a rest client in BAM 2.4.1. As the documentation[1] , once > the datareceiver api is invoked, It redirect to login page with 302 header > instead of creating the stream. > > What is the wrong with this api or am I missing anything > > [1] > https://docs.wso2.com/display/BAM241/Sending+Events+through+the+REST+API > > Below is the curl request and response I am getting. > > curl -k --user admin:admin > https://localhost:9447/datareceiver/1.0.0/streams/ --data > @streamdefn1.json -H "Accept: application/json" -H "Content-type: > application/json" -X POST -v > > * Adding handle: conn: 0x7fd1a9003000 > > * Adding handle: send: 0 > > * Adding handle: recv: 0 > > * Curl_addHandleToPipeline: length: 1 > > * - Conn 0 (0x7fd1a9003000) send_pipe: 1, recv_pipe: 0 > > * About to connect() to localhost port 9447 (#0) > > * Trying ::1... > > * Connected to localhost (::1) port 9447 (#0) > > * TLS 1.0 connection using TLS_RSA_WITH_AES_128_CBC_SHA > > * Server certificate: localhost > > * Server auth using Basic with user 'admin' > > > POST /datareceiver/1.0.0/streams/ HTTP/1.1 > > > Authorization: Basic YWRtaW46YWRtaW4= > > > User-Agent: curl/7.30.0 > > > Host: localhost:9447 > > > Accept: application/json > > > Content-type: application/json > > > Content-Length: 279 > > > > > * upload completely sent off: 279 out of 279 bytes > > < HTTP/1.1 302 Found > > < Set-Cookie: JSESSIONID=E0495E522FDB3810278BA76F0FBE29BC; Path=/; Secure; > HttpOnly > > < Set-Cookie: requestedURI=../../datareceiver/1.0.0/streams/; Path=/ > > < Location: https://localhost:9447/carbon/admin/login.jsp > > < Content-Type: text/html;charset=UTF-8 > > < Content-Length: 0 > > < Date: Wed, 04 Mar 2015 06:49:14 GMT > > * Server WSO2 Carbon Server is not blacklisted > > < Server: WSO2 Carbon Server > > < > > * Connection #0 to host localhost left intact > > > Thanks, > Nuwanw > > -- > Nuwan Wimalasekara > Senior Software Engineer - Test Automation > WSO2, Inc.: http://wso2.com > lean. enterprise. middleware > > phone: +94 71 668 4620 > > > > -- Nuwan Wimalasekara Senior Software Engineer - Test Automation WSO2, Inc.: http://wso2.com lean. enterprise. middleware phone: +94 71 668 4620
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
