We use Atlassian.Stash - C# API wrapper for Atlassian Stash, version v4.0.30319
C# .Net 4.8, Windows 10/1909
We migrated from Bitbucket Server to Bitbucket org, and have the error: Unexpected character encountered while parsing value: <. Path '', line 0, position 0
try
{
var client = new StashClient(ConfigParametres.GitBaseURL, username, password);
ResponseWrapper<Atlassian.Stash.Entities.Commit> allCommits = await client.Commits.Get("PROJECT_KEY", "REPOSITORY_NAME", null, null);
if (allCommits.Values == null)
{
return false;
}
}
catch (Exception ex)
{
return false;
}
I solve this issue by removing # and $ characters from my password.
Hi Mark,
Bitbucket Server aka Stash and Bitbucket cloud are 2 different products with 2 completely different REST APIs. Any client written to work with Bitbucket Server will not work as the URL paths will be completely different.
I would expect you will get a 404 not found HTML page as a response which cannot be parsed.
Here is the BBCloud REST API https://developer.atlassian.com/bitbucket/api/2/reference/
I'm not aware of a ready-to use client, but it may be out there.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ulrich,
We used https://github.com/jlouros/StashApiCSharp
Do you know about BBCloud analogue? I mean C# library.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We switched to another library
https://github.com/lvermeulen/Bitbucket.Cloud.Net
But there is an error when calling GetRepositoryCommitsAsync()
Source "Flurl.Http"
Message "Response could not be deserialized to JSON: GET https://bitbucket.org/2.0/repositories/bxbts/smscore/commits"
InnerException
Source "Newtonsoft.Json"
StackTrace
at Newtonsoft.Json.JsonTextReader.ParseValue()
at Newtonsoft.Json.JsonTextReader.Read()
at Newtonsoft.Json.JsonReader.ReadForType(JsonContract contract, Boolean hasConverter)
at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)
at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)
at Newtonsoft.Json.JsonSerializer.Deserialize[T](JsonReader reader)
at Flurl.Http.Configuration.NewtonsoftJsonSerializer.Deserialize[T](Stream stream)
at Flurl.Http.HttpResponseMessageExtensions.<ReceiveJson>d__0`1.MoveNext()
Message "Unexpected character encountered while parsing value: <. Path '', line 0, position 0."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.