标签: getresponse

WebRequest.GetResponse锁定了吗?

写下面的代码时,我的代码会锁定GetResponse.为什么?

        try
        {
            WebRequest myWebRequest = WebRequest.Create(strURL);
            WebResponse myWebResponse = myWebRequest.GetResponse();
            //more code here
Run Code Online (Sandbox Code Playgroud)

.net c# webresponse lockup getresponse

10
推荐指数
1
解决办法
6880
查看次数

WebRequest在ASP.NET应用程序中失败,"414 Request URI太长"

我们有一个ASP.NET应用程序,它在将报告的参数作为WebRequest传递后,以HTML格式请求SSRS 2005报告.只有在请求具有大量多选参数的报表时,应用程序才会失败,从而在该webRequest.GetResponse()行处抛出"414:Request URI too long"错误.

用于发出请求的代码是:

HttpWebRequest webRequest = null;
HttpWebResponse webResponse = null;
string webRequestURL = _ReportManager.GetRSUrl(reportID); //this passes the report link on the SSRS server

//make the request

Byte[] bytes = Encoding.UTF8.GetBytes("xml_doc=" + HttpUtility.UrlEncode(webRequestURL));

webRequest = (HttpWebRequest)WebRequest.Create(webRequestURL);
webRequest.Method = "POST";
webRequest.ContentLength = bytes.Length;
webRequest.Timeout = Configuration.WebRequestTimeOut;

RSExecution2005.ReportExecutionService rsE = new RSExecution2005.ReportExecutionService();
rsE.Url = Configuration.ReportExecutionServiceUrl2005;
rsE.Credentials = System.Net.CredentialCache.DefaultCredentials;
webRequest.Credentials = rsE.Credentials;

Stream reqStream = null;
reqStream = webRequest.GetRequestStream();
reqStream.Write(bytes, 0, bytes.Length);
reqStream.Close();

webResponse = (HttpWebResponse)webRequest.GetResponse();
Run Code Online (Sandbox Code Playgroud)

由于报告在服务器端失败,我已经查看了IIS和ReportServer属性,以字节方式增加maxUrl,maxRequestLength,MaxQueryString等(根据本文 …

c# iis httpwebrequest reporting-services getresponse

10
推荐指数
2
解决办法
1万
查看次数

c#httpwebrequest getResponse()冻结并挂起我的程序

我试图使用httpwebrequest在远程服务器上使用类似服务的休息,并且从第一次执行本身开始,我的代码挂起了程序.然后我尝试将它作为控制台应用程序,以确保它与程序本身无关,但没有运气!

        string credentialsJson = @"{""username"":""test"",
                                      ""password"":""test"" 
                                   }";

        int tmp = ServicePointManager.DefaultConnectionLimit;
        HttpWebRequest request = (HttpWebRequest)WebRequest.Create(@"https://qrua.com/qr/service" + @"/auth/login");
        request.Method = "POST";
        request.KeepAlive = true;
        request.Timeout = 50000 ;
        request.CookieContainer = new CookieContainer();
        request.ContentType = "application/json";
        try
        {
            StreamWriter writer = new StreamWriter(request.GetRequestStream());
            writer.Write(credentialsJson);
        }
        catch (Exception e)
        {
            Console.WriteLine("EXCEPTION:" + e.Message);
        }

        //WebResponse response = request.GetResponse();
        try
        {
            using (WebResponse response = (HttpWebResponse)request.GetResponse())
            {
                Console.WriteLine("request:\n" + request.ToString() + "\nresponse:\n" + response.ContentLength);
                response.Close();
            }
        }
        catch (Exception e)
        {
            Console.WriteLine("EXCEPTION: in sending …
Run Code Online (Sandbox Code Playgroud)

c# webrequest httpwebrequest getresponse

8
推荐指数
2
解决办法
2万
查看次数

getClass().getResource(resourcePath) 在 windows 上有效,在 Linux 上为 null

我有问题,这个电话

URL fileURL = getClass().getResource(resourcePath);

适用于 Windows (7 64b) 但不适用于返回 null 的 linux (Ubuntu 13.10 64b)。

为什么?文件在那里,字符串如下(相对路径)

String resourcePath = "/tut01/shaders/vertex_shader.glsl"
Run Code Online (Sandbox Code Playgroud)

两个文件都在我家

编辑:该项目是新克隆的,我忘了清理和构建,抱歉..所以现在它找到了它们。然而,这很奇怪,因为即使我修改了 vertex_shader.glsl,我的程序也将始终引用旧版本,每次编辑它时,我都需要执行清理和构建才能看到更改...为什么?在 Windows 上,我不必这样做..

java linux windows getresponse

7
推荐指数
1
解决办法
9633
查看次数

如何在默认情况下选中复选框?在Woocommerce结帐

有一个wordpress网站与woocommerce

我安装了Getresponse Woocommerce Integration插件,确实需要在结帐时将复选框默认为TICKED(他们勾选"注册我们的时事通讯"加入我们的电子邮件列表)

一直在尝试一切,真的很感谢如何做到这一点的帮助?

我怀疑我应该改变getresponse_integration.php第394行的内容

<input class="input-checkbox" value="1" id="checkout_checkbox" type="checkbox" name="checkout_checkbox">
Run Code Online (Sandbox Code Playgroud)

尝试插入像"已检查"这样的东西:

<input class="input-checkbox" value="1" id="checkout_checkbox" type="checkbox" name="checkout_checkbox" checked>
Run Code Online (Sandbox Code Playgroud)

这使得在结账时显示框被检查,但电子邮件不会被传递到列表,所以我没有收到任何欢迎电子邮件,也没有订阅.有趣的是,如果我手动取消框并重新调整,那么它可以工作

尝试过其他类似的东西=选择而没有运气?

真的很感激一些帮助吗?

PS尝试了getresponse支持,他们根本没有帮助

http://wordpress.org/plugins/getresponse-integration/

wordpress checkbox checkout getresponse woocommerce

5
推荐指数
3
解决办法
5105
查看次数

HttpWebResponse在循环运行时卡住了

我构建此方法(c#)以便从URL接收HTTP响应状态代码.我运行这种方法的时候它的工作正常,但是当我在一个循环中运行它时,它第三次卡住了.任何线索?

 public static string isAlive(string url)
    {
        Console.WriteLine("start: Is Alive Test");
        WebRequest request = WebRequest.Create(url);
        try
        {
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            return Convert.ToString((int)response.StatusCode);
        }
        catch(WebException ex)
        {
            HttpWebResponse res  = (HttpWebResponse)ex.Response;
            return Convert.ToString((int)res.StatusCode);
        }
    }
Run Code Online (Sandbox Code Playgroud)

循环

        for (int i = 0; i < 5; i++)
        {
            string a = isAlive("https://www.yahoo.com/");
            Console.WriteLine(a);
        }
Run Code Online (Sandbox Code Playgroud)

.net c# webrequest httpwebresponse getresponse

4
推荐指数
1
解决办法
2006
查看次数

如何从WP7中的服务器获得响应?

我正在尝试使用WP7上的HttpWebRequest类发送请求,但我没有得到任何响应......这是我的代码:

            InitializeComponent();
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://www.google.com/");
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            Stream dataStream = response.GetResponseStream();
            StreamReader reader = new StreamReader(dataStream);
            tbResponse.Text = reader.ReadToEnd();

            // Cleanup the streams and the response.
            reader.Close();
            dataStream.Close();
            response.Close();
            Console.ReadLine();
Run Code Online (Sandbox Code Playgroud)

此外,我使用此扩展:单击此处,但我在Windows控制台应用程序上测试它并没有任何问题,所以我认为问题是我不知道WP7的一些事情.

httpwebrequest getresponse windows-phone-7

3
推荐指数
1
解决办法
2455
查看次数

向主机发送大量请求时 System.Net.HttpWebRequest.GetResponse() 的操作超时

我正在向具有不同数据的特定 Web 服务发送大量并发请求。为了实现这一点,我创建了许多线程(大约 50 个)。每分钟的总请求数可能会增加到 10000。Windows 服务形式的应用程序可以正常运行几分钟,然后遇到操作超时错误。

我已经尝试了常见的怀疑方法,例如增加DefaultConnectionLimit、关闭 Web 响应对象。由于请求不会在服务器上花费太多时间,因此我还将请求超时ReadWriteTimeout 设置为 5 秒。下面是被不同线程重复调用的代码片段。

// Below line is executed at the start of application
ServicePointManager.DefaultConnectionLimit = 15000;

// Below code is executed at repeatedly by different threads
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Host = hostName;
request.Proxy = null;
request.UserAgent = "Windows Service";
byte[] bytes = new byte[0];
if (body != null)
{
    bytes = System.Text.Encoding.ASCII.GetBytes(body);
    request.ContentType = "text/xml; encoding='utf-8'";
    request.ContentLength = bytes.Length;
}
request.Method = "POST"; …
Run Code Online (Sandbox Code Playgroud)

c# timeout operation getresponse

2
推荐指数
1
解决办法
5169
查看次数

使用 thephpleague/oauth2-client 发出 POST 请求

我正在尝试使用 phpleague/oauth2-client 和 adespresso/oauth2-getresponse 作为提供商向 GETResponse API(https://apidocs.getresponse.com/v3/case-study/adding-contacts)发出 POST 请求,如下所示:

  $data = [
            'email' => $email,
            'campaign' => [
                'campaignId' => $campId
            ]
        ];
    $request = $this->provider->getAuthenticatedRequest(
                        'POST',
                        'https://api.getresponse.com/v3/contacts',
                        $this->getMyAccessToken(),
                        $data
            );
    $response = $this->provider->getParsedResponse($request);
Run Code Online (Sandbox Code Playgroud)

我还尝试在标头中传递 application/json 的内容类型值,但没有成功。

$data = [ 'email' => $email, 'campaign' => [ 'campaignId' => $campId ] ];

    `$options['body'] = json_encode($data);
    $options['headers']['Content-Type'] = 'application/json';
    $options['headers']['access_token'] = $this->getMyAccessToken();
    $request = $this->provider->getAuthenticatedRequest(
                        'POST',
                        'https://api.getresponse.com/v3/contacts',
                        $options
            );
    $response = $this->provider->getParsedResponse($request); `
Run Code Online (Sandbox Code Playgroud)

然而,两种方法中的 getParsedResponse 函数都会返回以下内容:

League \ OAuth2 \ …
Run Code Online (Sandbox Code Playgroud)

request getresponse oauth-2.0 guzzle guzzle6

2
推荐指数
1
解决办法
2462
查看次数

为什么我的intellisense没有列出HttpWebRequest.GetResponse方法?

using System;
using System.Net;
using System.Xml.Linq;


namespace PhoneApp1
{
    public class ABC
    {
        //constructor

        public ABC()
        {


        }

        void abc()
        {
            String url = "";

            HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse resp = (HttpWebResponse)req.GetRepsonse(); //why a wiggly line here?
            XDocument Xmldoc = XDocument.Load(url);
        }
Run Code Online (Sandbox Code Playgroud)

我没有得到GetResponse()这个req对象.为什么会这样?

这个链接和许多链接说它应该是可能的.

c# httpwebrequest getresponse windows-phone-7

0
推荐指数
1
解决办法
515
查看次数