WebClient set headers

后端 未结 4 963
栀梦
栀梦 2021-01-07 16:34

How I can set a header in the webClient class? I tried:

client.Headers[\"Content-Type\"] = \"image/jpeg\";

that throws a

4条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-07 16:45

    Have you tried this syntax: client.Headers.Add("Content-Type", "image/jpeg");

    What's your stack trace? At what point are you setting this? And what version of IIS/OS are you running under?

提交回复
热议问题