Question HTML POST action

debjit625

New member
Joined
Oct 1, 2017
Messages
2
Programming Experience
Beginner
Hi this is my first post,I don't no very much HTML stuff but this is what I need to do.

I have this website (page) where I can download a csv file (just some stock data) ,now this download link "Download in csv" is not a simple hyperlink as far i understand it initiate a form action to post like this from its source code

C#:
                          </div>
			  <form name="dataform" autocomplete="off" action="/csv/csvdownload.jsp" method="post">
			  <div><INPUT TYPE="hidden" NAME="datacsv" ID="datacsv"></div>
			  <div></div>

I also initiated Live HTTP headers to see the POST action and this is what I got

C#:
POST /csv/csvdownload.jsp HTTP/1.1
Host: www.nseindia.com
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:55.0) Gecko/20100101 Firefox/55.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 10348
Referer: https://www.nseindia.com/live_market/dynaContent/live_watch/equities_stock_watch.htm?cat=N
Cookie: pointer=3; sym1=HINDALCO; sym2=FEDERALBNK; sym3=GAIL
Connection: keep-alive
Upgrade-Insecure-Requests: 1
datacsv=Symbol%2COpen%2CHigh%2CLow%2CLast+Traded+Price%2CChange%2C%25Change%2CTraded+Volume%28lacs%29%2CTraded+Value%28crs%29%2C52+Week+High%2C52+Week+Low%2C365+Days+%25+Change%2C30+Days+%25+Change%3A%22NIFTY+......................I deleted the rest data.

You could see the whole data is posted to by the variable or header datacsv.

Now I want to know how the page is making this data "datacsv" as I am actually interested in this data.
What I want to do is within a C# application (Winform) I want to access this datacsv or initiate the download data.csv file ,I was trying to use HttpWebRequest class but to post the data datacsv I have to have it first what should I do.

Sorry if I sound very confusing because I am.

Thanks for any help or pointer in the direction.
 
I've never actually done what you want to do but, if I did, I'd search the web for "c# httpwebrequest post". I just did that and found a number of results that looked relevant.
 
Thanks jmcilhinney I am not concern about C# code I know how to do that, what I was after is that how the webpage is making that data,I guess I have some idea now on it and working on it,anybody interested its DOM (Document Object Model) which after executing the scripts modify the HTML page and provide the data.
 
Back
Top Bottom