Skip to content

ListResourcesAsync not working #3

@IharYakimush

Description

@IharYakimush

package <package id="Cloudinary.Core" version="1.31.0" targetFramework="net461" />
referenced from netstandard2.0 assembly
referenced from net461 executable file
with binding redirects:

      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="B03F5F7F11D50A3A" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
      </dependentAssembly>

Code:

    Cloudinary cloudinary = new Cloudinary(
                new Account(
                    this.cloudinaryConfiguration.Cloud,
                    this.cloudinaryConfiguration.ApiKey,
                    this.cloudinaryConfiguration.ApiSecret));

        cloudinary.ListResourcesAsync(
                    new ListSpecificResourcesParams { PublicIds = new List<string> { Guid.NewGuid().ToString("N") } })
                .ConfigureAwait(false).GetAwaiter().GetResult(); 

Exception:

System.Net.ProtocolViolationException: Cannot send a content-body with this verb-type. 
at System.Net.HttpWebRequest.CheckProtocol(Boolean onRequestStream) 
at System.Net.HttpWebRequest.BeginGetRequestStream(AsyncCallback callback, Object state) 
at System.Net.Http.HttpClientHandler.StartGettingRequestStream(RequestState state) 
at System.Net.Http.HttpClientHandler.PrepareAndStartContentUpload(RequestState state) 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Net.Http.HttpClient.d__58.MoveNext()
 --- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at CloudinaryDotNet.Api.d__47.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at CloudinaryDotNet.Cloudinary.d__34.MoveNext() 
--- End of stack trace from previous location where exception was thrown --- 
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() 
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) 
at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()

Upload and Explicit operations works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions