Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have two problems:

First, when I am trying to get data from this website it goes well within browser but when I send request using httpwebrequest in C# it responds with this message. In first attempt it may return data but if the send request again it returns this message.

{
    "message": "refresh"
}


Second, when I go to page-2 or click next to go to another page it generates numbers (in end) which is not consistent changes everytime I refresh browser. How can I get these numbers? For example: "=1559040099084" like this.

Link

[API]

URI used is the web address in the APILink above.


HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(URI);
            request.Headers.Add("IfModifiedSince", DateTime.Now.ToString());
            request.Method = "GET";
            string result = string.Empty;
            using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
            {
                Stream dataStream = response.GetResponseStream();
                StreamReader reader = new StreamReader(dataStream);
                result = reader.ReadToEnd();
                reader.Close();
                dataStream.Close();
            }
            Debug.Write(result);


What I have tried:

I have searched for similar questions but not getting related question. Secondly I have posted this question on Stackoverflow but didn't get any respond.
Posted
Updated 28-May-19 4:39am
Comments
Richard Deeming 29-May-19 10:59am    
How about asking the people who provide the API? They are the only people who can answer your questions.
NOOSL 29-May-19 11:42am    
I understand but anyone with knowledge of understanding with web response can help.
Richard Deeming 29-May-19 11:46am    
No need to overreact. We're happy to help with C# issues. But if you're having a problem with a third-party API, then the people who wrote that API are almost always the only ones who can help.

We don't have access to the API, and we don't have access to their source code. Unless you happen to meet another user who has used this exact API and overcome this exact problem, all we can do is give you vague general advice, or point you to the documentation.

1 solution

Examine the HttpWebResponse object's properties to get more info on what went wrong.
 
Share this answer
 
Comments
NOOSL 28-May-19 12:50pm    
How can I see object's properties. I don't have knowledge about this. Can you help me finding. Thanks
#realJSOP 28-May-19 13:56pm    
I'm assuming you have access to the source code and know how to use the debugger. Is that not the case?
NOOSL 29-May-19 0:30am    
I have access to the source code but don't how to check using debugger.
#realJSOP 29-May-19 4:12am    
Well then, task #1 would be to learn how to use the debugger. We can't debug the code for you because we don't have your code (and no, we don't want your code).
NOOSL 29-May-19 4:51am    
I think you misunderstood my question. I wrote website respond with message refresh. That has nothing to do with debugging. That has something to check with the browser what information is missing in my httprequest. Secondly what exactly you meant with object's properties. Which property? Give me detail answer if you willing to help. Not just commenting generally. If I can do everything self then I don't need to post this question on website.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900