posting to a href link
-
Hello, I am developing a small c# application which simulates some simple feature of a web client . I expecially need to "redirect" this application to a page whenever I meet a tag. I initially thought I could simply use a WebRequest object for this, using the href="...." attribute as the URI where to direct the Post, but I keep catching the "internal server error (500)" web exception . So I wonder , am I doing the right thing ? Am I correct in thinking that an Html anchor tag makes a http post to the url specified in the href attribute, or is it something totally different ?
-
Hello, I am developing a small c# application which simulates some simple feature of a web client . I expecially need to "redirect" this application to a page whenever I meet a tag. I initially thought I could simply use a WebRequest object for this, using the href="...." attribute as the URI where to direct the Post, but I keep catching the "internal server error (500)" web exception . So I wonder , am I doing the right thing ? Am I correct in thinking that an Html anchor tag makes a http post to the url specified in the href attribute, or is it something totally different ?
It's not quite that simple. The
href=""
link is usually only followed when the user clicks on it, and always uses the GET method, not POST. You might also need to include any cookies that were received with the page when you make your request. -
It's not quite that simple. The
href=""
link is usually only followed when the user clicks on it, and always uses the GET method, not POST. You might also need to include any cookies that were received with the page when you make your request.In effect the cookie problem is something I had completely neglected : to include this I guess I should load the "Referer"page first, extract the cookies associated with it and include them in the following GET that simulates the "href" anchor... am I right ?
-
In effect the cookie problem is something I had completely neglected : to include this I guess I should load the "Referer"page first, extract the cookies associated with it and include them in the following GET that simulates the "href" anchor... am I right ?
Whether you should include a cookie or not depends on the domain and path specified in the cookie, the domain and path of the new page you are loading, the cookie lifetime, etc. Here's a link to RFC 6265[^] where you can read all about them. I don't know how you are dealing with the contents of the
href=""
attribute, but you will have to cope with absolute links, relative links,<base href="...">
affecting the link location, and also deal with possible non-http links ("javascript:" and "mailto:" are two examples off the top of my head). -
Whether you should include a cookie or not depends on the domain and path specified in the cookie, the domain and path of the new page you are loading, the cookie lifetime, etc. Here's a link to RFC 6265[^] where you can read all about them. I don't know how you are dealing with the contents of the
href=""
attribute, but you will have to cope with absolute links, relative links,<base href="...">
affecting the link location, and also deal with possible non-http links ("javascript:" and "mailto:" are two examples off the top of my head).well I am quite confident that the href attribute of the anchor is always an absolute link. Anyway I included the cookies and this time it seems I made a small step forward , at least now I'm not getting the http 500 error anymore, and I can get a response too (well it's a null string , but this is a detail .. :)))....). What puzzles me is that if I use the raw href url in a web browser call, for instance using IE, I get the requested page without any error... it doesn't seem to expect any cookies form a previous response .... But I am deeply ignorant as far as the web is concerned , I'm sure there's an answer to this. What's important for now is that at least I can get past the WebResponse .... Thanks for the support.
-
Hello, I am developing a small c# application which simulates some simple feature of a web client . I expecially need to "redirect" this application to a page whenever I meet a tag. I initially thought I could simply use a WebRequest object for this, using the href="...." attribute as the URI where to direct the Post, but I keep catching the "internal server error (500)" web exception . So I wonder , am I doing the right thing ? Am I correct in thinking that an Html anchor tag makes a http post to the url specified in the href attribute, or is it something totally different ?
You may simply just link that page attributes with each other for any of your business website design service site & make that paragraph as a simple text and place an anchor tag at it. The results would be really great if you could bring it out as a do follow link rel.