Cannot send a content-body with this verb-type

前端 未结 4 1481
醉酒成梦
醉酒成梦 2020-11-29 00:32

I just got this exception (ProtocolViolationException) in my .NET 2.0 app (running on windows mobile 6 standard emulator). What confuses me is that as far as i know, I have

4条回答
  •  执念已碎
    2020-11-29 01:05

    I had the similar issue using Flurl.Http:

    Flurl.Http.FlurlHttpException: Call failed. Cannot send a content-body with this verb-type. GET http://******:8301/api/v1/agents/**** ---> System.Net.ProtocolViolationException: Cannot send a content-body with this verb-type.

    The problem was I used .WithHeader("Content-Type", "application/json") when creating IFlurlRequest.

提交回复
热议问题