gpt4 book ai didi

c# - 通过 C# 代码发出 http 请求?

转载 作者:行者123 更新时间:2023-11-30 20:09:33 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
Render a view as a string

你好

我想知道是否有可能在您的 C# 代码中(通过一个在它自己的线程上并且不了解 httpcontext 的调度程序)一个发送到 Controller 的请求?

//server side code
// do calculations
// post to a controller that takes in a list of view models
// do stuff with the collection of view models.

public myControllerIwantToCallFromServerSide(List<VM> viewModels)
{
// stuff here
}

我需要一些方法来执行 http 请求,以便我可以获得一个 httpcontext,因为我需要一个实时 http 上下文来使用一个库(action mailer),该库采用 mvc View 并将其呈现为电子邮件并发送。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com