login api added to readme

pull/12/head
moneroexamples 7 years ago
parent 3e686805e2
commit 00334cb69d

@ -227,6 +227,16 @@ Example output:
}
```
### login
```bash
curl -w "\n" -X POST http://127.0.0.1:1984/login -d '{"address": "A2VTvE8bC9APsWFn3mQzgW8Xfcy2SP2CRUArD6ZtthNaWDuuvyhtBcZ8WDuYMRt1HhcnNQvpXVUavEiZ9waTbyBhP6RM8TV", "view_key": "041a241325326f9d86519b714a9b7f78b29111551757eeb6334d39c21f8b7400"}'
```
```json
{"new_address":false,"status":"success"}
```
#### get_address_info
```bash

@ -61,7 +61,7 @@ YourMoneroRequests::login(const shared_ptr<Session> session, const Bytes & body)
auto response_headers = make_headers({{"Content-Length", to_string(response_body.size())}});
session->close( OK, response_body, response_headers);
session->close(OK, response_body, response_headers);
return;
}
@ -103,6 +103,7 @@ YourMoneroRequests::login(const shared_ptr<Session> session, const Bytes & body)
if (CurrentBlockchainStatus::start_tx_search_thread(acc))
{
cout << "Search thread started" << endl;
j_response["status"] = "success";
j_response["new_address"] = false;
}
@ -111,7 +112,6 @@ YourMoneroRequests::login(const shared_ptr<Session> session, const Bytes & body)
j_response["status"] = "error";
j_response["reason"] = "Failed created search thread for this account";
}
}
else
{

Loading…
Cancel
Save