Skip to content

Commit 2bc117b

Browse files
author
Damian Kowalewski
committed
add suport to specify custom server url for Arduino Yun
1 parent 8d13294 commit 2bc117b

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

src/internal/ParseClient.h

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,17 @@ class ParseClient {
8282
*/
8383
void begin(const char *applicationId, const char *clientKey);
8484

85+
/*! \fn void setServerURL(const char *serverURL)
86+
* \brief Set the installation object id for this client.
87+
*
88+
* Set the custom server url for this client. This needs to be called
89+
* API request.
90+
*
91+
* \param serverURL The server URL to which client should connect.
92+
*
93+
*/
94+
void setServerURL(const char *serverURL);
95+
8596
/*! \fn void setInstallationId(const char *installationId)
8697
* \brief Set the installation object id for this client.
8798
*
@@ -146,7 +157,7 @@ class ParseClient {
146157
* \brief Directly call REST API in Parse.
147158
*
148159
* \param httpVerb - GET/DELETE/PUT/POST
149-
* \param httpPath - the endpoint of REST API e.g. /1/installations
160+
* \param httpPath - the endpoint of REST API e.g. /installations
150161
* \param requestBody - http request body in json format, leave it as "" for DELTE/GET requests
151162
* \param urlParams - leave it as "" unless to perform a Parse query,
152163
* use it to specify query condition e.g. where={"KEY1"":VALUE1}&limit=10&keys=KEY1,KEY2
@@ -160,7 +171,7 @@ class ParseClient {
160171
* \brief Directly call REST API in Parse.
161172
*
162173
* \param httpVerb - GET/DELETE/PUT/POST
163-
* \param httpPath - the endpoint of REST API e.g. /1/installations
174+
* \param httpPath - the endpoint of REST API e.g. /installations
164175
* \param requestBody - http request body in json format, leave it as "" for DELTE/GET requests
165176
* \param urlParams - leave it as "" unless to perform a Parse query,
166177
* use it to specify query condition e.g. where={"KEY1"":VALUE1}&limit=10&keys=KEY1,KEY2

src/internal/ParseRequest.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
ParseRequest::ParseRequest() {
2626
requestBody = "{";
27-
httpPath = "/1/";
27+
httpPath = "/";
2828
isBodySet = false;
2929
}
3030

src/internal/yun/ParseClient.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ void ParseClient::begin(const char *applicationId, const char *clientKey) {
4949
}
5050
}
5151

52+
void ParseClient::setServerURL(const char *serverURL) {
53+
if (serverURL) {
54+
Bridge.put("serverURL", serverURL);
55+
}
56+
}
57+
5258
void ParseClient::setInstallationId(const char *installationId) {
5359
strncpy(this->installationId, installationId, sizeof(this->installationId));
5460
if (installationId) {

0 commit comments

Comments
 (0)