Closed shibuya246 closed 6 years ago
looks like if we can edit the PrepareUri function to accept the extra params, then it could work, either adding the params to queryBuilder when it gets passed it, or setting a new param passing it to the PrepareUri function direct
private Uri PrepareUri(string path, QueryBuilder queryBuilder)
{
var authToken = !string.IsNullOrWhiteSpace(_config.AuthSecret)
? $"{path}.json?auth={_config.AuthSecret}"
: $"{path}.json?";
var queryStr = string.Empty;
if (queryBuilder != null)
{
queryStr = $"&{queryBuilder.ToQueryString()}";
}
var url = $"{_config.BasePath}{authToken}{queryStr}";
return new Uri(url);
}
In QueryBuilder.cs https://github.com/ziyasal/FireSharp/blob/master/FireSharp.Core/QueryBuilder.cs
there is already options for "shallow" although that only works on GET requests
line 74
public QueryBuilder Shallow(bool value)
{
return AddToQueryDictionary(shallowParam, value ? "true" : string.Empty, skipEncoding: true);
}
a similar choice for "silent" would fit in consistently with code here
I have added code to make this work now with Tests as well, and want to publish a branch so i can open a pull request. I don't seem to have permission to access this repository for that.
We are uploading new data to a node on firebase on a regular basis. We do not want to get the uploaded data, sent back in the response stream, as it consumes our firebase download quota.
If we use push, it does not contain the uploaded data in the response stream, but we cannot specify the key.
why is all of the data returned on both set and update? is there someway to set a flag to not return data? can there be a feature such as,
** RETURNING DATA FirebaseResponse response =await _client.UpdateAsync("todos/set", todo); Todo todo = response.ResultAs(); //The response will contain the data written
** NOT RETURNING DATA FirebaseResponse response =await _client.UpdateAsync("todos/set", todo, false); //The response will NOT contain the data written
Posisble Solution from the google firebase docs:
curl -X PUT -d '{ "first": "Jack", "last": "Sparrow" }' \ 'https://[PROJECT_ID].firebaseio.com/users/jack/name.json?print=silent'