Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. System.net.http.httprequestexception Error while copying content to a stream' on 401 API Response

System.net.http.httprequestexception Error while copying content to a stream' on 401 API Response

Scheduled Pinned Locked Moved Web Development
csharpasp-netdotnetvisual-studiojson
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BalasubramanianK
    wrote on last edited by
    #1

    Hi, I have a web API method and it returns IEnumerable. Cases is a wrapper class of "Proc" Class. I am consuming this web API from my client. If Proc has count 0, I can able to get data in my client from Web API. When Proc has value (greater than count 0), I get error "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host". I am working in VS 2017 and .Net Core 2.1 Please advise Cases.cs public partial class Cases { public CaseDetails() { CaseProcedures = new HashSet(); } public int Id { get; set; } public int UniqueNumber { get; set; } public HashSet Proc { get; set; } } Proc.cs public partial class Proc { public int Id { get; set; } public int CasesId { get; set; } }

    Balasubramanian K.

    N 1 Reply Last reply
    0
    • B BalasubramanianK

      Hi, I have a web API method and it returns IEnumerable. Cases is a wrapper class of "Proc" Class. I am consuming this web API from my client. If Proc has count 0, I can able to get data in my client from Web API. When Proc has value (greater than count 0), I get error "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host". I am working in VS 2017 and .Net Core 2.1 Please advise Cases.cs public partial class Cases { public CaseDetails() { CaseProcedures = new HashSet(); } public int Id { get; set; } public int UniqueNumber { get; set; } public HashSet Proc { get; set; } } Proc.cs public partial class Proc { public int Id { get; set; } public int CasesId { get; set; } }

      Balasubramanian K.

      N Offline
      N Offline
      Nathan Minier
      wrote on last edited by
      #2

      Yeah, you do know that a 401 code is an authorization failure, I trust. The W3C is your friend! The HTTP 1.1 status codes apply to 1.2 as well. [HTTP/1.1: Status Code Definitions](https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)

      "Never attribute to malice that which can be explained by stupidity." - Hanlon's Razor

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups