Click here to Skip to main content
15,888,112 members
Everything / HTTP

HTTP

HTTP

Great Reads

by honey the codewitch
Explore an Arduino based IoT web server and UDP multicaster for monitoring a remote water pump
by Michael Haephrati
A simple way for sending WhatsApp messages to an individual or to a group in C++
by Max R McCarty
OWASP's #6 most vulnerable security risk has to do with keeping secrets secret.
by Ivan Yakimov
The article contains comparison of pure HttpClient with RestSharp and Refit.

Latest Articles

by honey the codewitch
Scraping the web is easy with Visual FA. Here's an example of how.
by Jason Sultana
Understanding and preventing Newline Injection
by Ivan Yakimov
The article contains comparison of pure HttpClient with RestSharp and Refit.
by ToughDev
How to fix PlatformNotSupportedException when running WCF apps

All Articles

Sort by Updated

HTTP 

18 Jan 2011 by #realJSOP
Use HttpWebRequest, and you'll get a web page back. At that point, you can parse the html/xml. There are several CodeProject articles that discuss how to do these things. I've written a couple, as have others:CodeProject Article Scraping[^]CodeProject Article Scraper,...
28 Jul 2011 by #realJSOP
Try using this:string url = Request.RawUrl;If you want the physical file path:string path = new Uri(Request.RawUrl).Absolute.Path;
30 Jul 2011 by #realJSOP
Okay. Here's help describing how you can find out:491,000 Google results for the saerch phrase "c# httpwebrequest"[^]
14 Dec 2018 by 1suli0
Code goes like this: public async Task CreateUser(AppUser user, RegisterUserDto dto) { try { var result = await _userManager.CreateAsync(user, dto.Password); if (result.Succeeded) { ...
14 Dec 2018 by 1suli0
Configuring this in serializer options solved the problem. services.AddMvc(options=>....).AddJsonOptions(opt=> opt.SerializerSettings.ReferenceLoopHandling=Newtonsoft.Json.ReferenceLoopHandling.Ignore);
26 Mar 2014 by _jarvis
sam,You can use Json.Net from JNK or either of JavaScriptSerializer and DataContractJsonSerializer from MS directly. But Json.Net is pretty easy to use so would recommend to go with that!
14 Sep 2011 by _jliu
Hello everyone:I am new in .net programming and need some help. My intention is to post data to a web server and get desired service. The functionality of the program in my mind is that: After an initial log-in session with username/password, the following sessions only accepts key-value...
9 Dec 2015 by _Q12_
I use this code to be able to read a web page content.I don't know what is doing. All I know is that is working for every website I test it. I have a separate button for this code I provide here, just to initialize something - I presume is the server initialization. After the server...
24 Nov 2014 by Abdallah Al-Dalleh
Hello allI have a C++ project under Linux, the program will receive Xml content through HTTP requests. I have already planned for XML content parsing by using the TinyXML-2 library, I'm stuck at the point on how to receive HTTP requests. Any advice on how to handle HTTP requests that are...
27 Nov 2014 by Abdallah Al-Dalleh
How to handle post data coming inside an HTTP POST request
27 Nov 2014 by Abdallah Al-Dalleh
For anyone facing this problem, see this:Capture Incoming HTTP Requests to the Web Server[^]
3 Feb 2014 by abdul subhan mohammed
Your answer is here:Use flags
10 Feb 2015 by Abhinav S
You can use either TCP sockets or WCF.Try these links below -An Asynchronous Socket Server and Client[^]Simplified Asynchronous Programming Model in WCF with async/await[^]Task-based Asynchronous Operation in WCF[^]
10 Nov 2015 by Abhinav S
Try these links -Calling ASP.NET WebAPI using HttpClient[^]Calling a Web API From a .NET Client in ASP.NET Web API 2 (C#)[^]Using HttpClient to Consume ASP.NET Web API REST Services[^]
21 Dec 2011 by Addy Tas
Hi, It would help if you could identify on what line you got the error but looking at the code it seem that you are trying to handle a async call in a synchrounous way.You should call the EndGetResponce from the callback and as such make sure that the data buffer can be accessed (safely)...
11 Aug 2014 by adeelIdealist
I can easily upload files with ftp protocol using inet control in vb6. But with http protocol, I'm getting an error "unable to complete request". And I am not sure if my server supports http upload. Any help plz
1 Feb 2013 by AdityaPratapSingh
this shows file name with directory depth path
23 Jun 2017 by Adrax /PSHQ/
Hi! I'm trying to get response from a server. At the moment, it returns this: https://pastebin.com/raw/1K8iZT74 However, I don't want the full response with server header. I only wan't the "Hello world!" part to be returned. How do I approach this ? Any ideas ? My Code so far:...
23 Jun 2017 by Adrax /PSHQ/
Look. I just need to get simple response without the server header. That's all Im trying to achieve with winsock. It's not about the request. It's about parsing the response correctly (leaving out the server header in my case).
5 Dec 2013 by Aescleal
The simplest way is three calls to curl_easy_setoptCURLOPT_POST tells the library that you're going to do a post.CURLOPT_POSTFIELDS tells the library that this is a pointer to the data that you want to send in exactly the form the server expects it. It's up to you to make sure that this...
24 Nov 2014 by Aescleal
One good thing about being a special purpose HTTP server is that you don't have to process the entire protocol and you can just handle the bits you want and send an error message for just about anything else. While lbcurl can help it's mostly for HTTP clients, not servers so I wouldn't bother...
9 Nov 2014 by Afzaal Ahmad Zeeshan
First thing that I forced me to answer this question was, you said "continously need to call the webservice using Timer". Why? It is not a good user experience for most of the Android users. I am having an Android mobile phone that has only 128mb Ram and a single core processor and I just don't...
27 Nov 2014 by Afzaal Ahmad Zeeshan
Well, you can create your own Exception that would inherit from the base Exception class. That would have the text and a name that would tell the user that this is bad - well, it will tell him what went wrong. For creating customs, you can read this document[^]. It will be like this,...
3 Aug 2019 by Afzaal Ahmad Zeeshan
Since you want to parse an HTML document and read its contents, there are two ways. First of them (the easy way) would be to use an HTML parser and then read the header values one by one. I have not heard of any in Java but with C# we had HtmlAgilityPack[^]; which in Java is somewhere to be like...
18 Mar 2022 by Ahiri
Hi,I want to pass the byte array into insert query but I am not using the parameter. I am directly passing values into insert query.I am getting the following error:at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response,...
24 Jan 2014 by Ahmed Bensaid
Hello,Maybe there are too many cookies on your website ;)http://stackoverflow.com/questions/10977655/http-400-request-header-too-long-error-when-accessing-asp-net-application[^]
11 Feb 2014 by Ajay J Singh
you can use webservice or wcf service.and simply add the webreference the of the service in your window application code.
30 Oct 2012 by ajithk444
hi,I need to call a http handler using JQuery in my aspx page on button click. The handler must execute a method when it is called.pls help me how to do this. give me some sample about this. i am new to http handlers and Jquery.pls help me.. The handler must actually generate a pdf report...
1 Nov 2012 by ajithk444
Hi,I have an application in which i have inplemented an http handler. I m calling this handler with jquery from my aspx button click. I have written code for the handler to return a pdf file. I want the browser to prompt for open or save option when i click the button. My code is rendering...
28 Mar 2013 by akil chehade
Dears,i have downloaded SecuritySwitch 4.1 - Example Source Code,i have faced an error during opened a secure page.(example:"https://localhost:44342/SecureExampleWebSite/Login.aspx",i have got this message:Unable to connect Firefox can't establish a connection to the server at...
9 Nov 2014 by akshaya srinivasan
I have created an one to one chat application using HTTP connection (In this method each and everytime you want to send message, you have to call the webservice and for receive message, you continously need to call the webservice using Timer).Now I want to implement group chat app.Can some one...
25 Mar 2011 by al_in_the_city
Hello Everyone,I have written an application that transfers files using FTP. I now need to change this program since some of my clients no longer allow FTP applications and are requesting that I use HTTP/HTTPS instead. Does anyone know of any commercial libraries/SDK that I could use to...
18 Jul 2016 by Ala Chaabouni
I am using the firehose tracer in RabbitMQ.For this example, I have a queue called Calculator bound to a headers exchange.To read the logs using a Java client, I am using the HTTP API to read the log files using this code :URL url = new...
25 Apr 2011 by Albin Abel
The error is self describing. The Uri you are accessing not giving access at port 80 which is restricted for security reasons. Try to access it in browser and if not works contact the site owner for more information. If it is your site then check the permissions.
9 Jul 2017 by Alejandro Xalabarder
13 Oct 2021 by Alexander Angelopoulos
public string Execute(string url, DataSet dsItem) { using (HttpClient client = new HttpClient()) { client.BaseAddress = new Uri(url); ...
28 Oct 2015 by Alexander Iskhakov
Creating a HTTP proxy using Play framework and WS API
25 Jan 2017 by Alibaba Cloud
This article briefly introduces how to use Zipkin to perform service analysis on Spring Cloud applications. In practical application, Zipkin can be used in combination with stress testing tools to analyze the availability and performance of systems under high stress.
25 Feb 2011 by alibatfire
I am writing C# Coded UI Tests in Visual Studio 2010. To enhance the testing, I need to access all the responses coming back from the server. For instance, I am testing the Add New Member use case, if user’s attempt to add a new member fails, and the UI doesn't show neither the success or...
31 Jul 2017 by Alvin Bunk
Apache HTTP server optimization
16 Aug 2017 by Alvin Bunk
Client sent HTTP/1.1 request without hostname
13 Apr 2011 by Amit Kumar Tiwari
Try the link http://weblogs.asp.net/pwilson/archive/2004/12/23/331455.aspx[^]This may answer all your questions.
2 Nov 2011 by amit_upadhyay
What i want is to download multiple url webpages using multi-threading and also add the content from each page to a similar richtextbox. But iam ending up with only single thread content being added multiple times into the richtextbox. My code is : For i As Integer = 0 To...
11 Oct 2012 by AmitGajjar
Hi,You can even redirect your site using DNS entry from your server. That way you do not have to keep default page on your old site. just made one entry to redirect page on the new https location. If you want to redirect using your default page then you can use Response.Redirect to...
24 Apr 2014 by Amogh Natu
This tip explains how to call a web method with a POST request using xml request messaage in C#.
12 Apr 2013 by Amogh Natu
This article mainly explains what webhooks are, how they can be created and used and also a sample example showing the use of webhooks.
7 Oct 2011 by amove1
It is easy to import and use SOAP webservice with web reference facility in Visual Studio, however setting SOAPAction needs a extra work on webreference libraries specially when using third party Java provided services.
6 Mar 2018 by Amu Kulkarni
I am trying to call a webservice to add Employee to sql database through my AngularJS application. Http Get method working fine in same application. Error: POST...
16 Oct 2015 by Andy Feng
The article introduces a complete C# solution to grab Html data through POST request from remote server and extract fields from the Html source through parsing its DOM structure.
12 Aug 2011 by Aniruddha Loya
How to set up Apache 2.2 on MacOS to test websites with self generated certificates in order to verify settings for secure HTTP (HTTPS)
25 Feb 2012 by Anirudha_Gohokar
I want to create a website with URL as my IP-address[ex: 192.X.X.X]That website would respond with a "HELLO THERE" message to any user who accesses my URL.I use the following code to do this![its just a basic code with no threading]class listenToHTTP{ HttpListener _listner; ...
6 Dec 2012 by AnkitGoel.com
i suggest you not to try this. firstly, this is illegal as per yahoo and gmail policy. Second, they won't let you implement such a program, the only way is a hack which i don't think is possible. You can only use gmail and yahoo login in your application but can't implement sign-up.
5 Dec 2012 by Anselmo santos
I have the following code in C# but it is not working. I am new to the whole C# and parsing thing but I need to get this working. Anyone knows why i am getting:"Object reference not set to an instance of an object."using System.Text;using HtmlAgilityPack;namespace HtmlParser{ ...
11 Feb 2014 by AnuradhaJayalath
If you can enter your code here..
7 Nov 2018 by Apriorit Inc, gamapat
Take a look at how to intercept HTTP traffic in order to inject custom code into Windows HTML markup
12 May 2014 by AR547
Hi All,This is really a challenging issue I have ever faced in development.Googled every solution but couldn't find any perfect solution as per my requirement..I have a generic method in a class file RequestTemplate.cs in which HTML Table is being constructed so that this table will be...
9 Nov 2011 by Areff
Hello every bodyi have developed a wcf app using .net framework 4.0,i have not problem with it and it is working without error in my local machine.but i changed the machine and deploye it in a server that has rooted IIS (with public IP).public interface IOssServices { ...
8 Jul 2011 by Arindam Tewary
Did you see whether the url "http://localhost:8080/Devices.xml[^]"works fine in both the cases?t looks like the source "Device.xml" is not in correct position( like as you wanted to access the file from this location: http://localhost:8080/Devices.xml[^])Check the path.And again if...
14 Jan 2016 by Asher Barak, Itiel Beeri
Infrastructure for large scale WCF services layer development
11 Oct 2012 by AshishChaudha
Try following code in global.asax //This code work only on server void Application_BeginRequest(object sender, EventArgs e) { if (HttpContext.Current.Request.Url.ToString().ToLower().Contains("http:")) { ...
14 Oct 2013 by AshLiGaLa
I've created a service using this link :http://arcanecode.com/2007/05/22/windows-services-in-c-getting-started-part-2/[^]I configure my config for https, but cannot start my service. I get this error "Service cannot be started. System.InvalidOperationException: Contract requires Session,...
23 Sep 2012 by askfriends
Hi;i just came on this site while searching for my query and i cant find what i needed, so i thought i should post my query here and wait for experts to answer.i am newbie so don't know about it.i want to set content expire date or whatever you call it for next 7 days or 1 month, which...
11 Oct 2013 by ASP.NET Community
HttpWebRequest The HttpWebRequest class allows you to programatically make web requests against an HTTP server. This code shows how to read a
11 Oct 2013 by ASP.NET Community
OpenRasta is an open-source .NET framework for building everything web, from web sites to RESTful APIsWhy OpenRasta?OpenRasta relies on three
11 Oct 2013 by ASP.NET Community
Being a new web developer can be hard. There are way too many technologies and frameworks to learn and it is very easy to get lost in the sea of buzz
11 Oct 2013 by ASP.NET Community
Hi,In this article i am going to create an http Handler which is used to resize my images and display it  .What are HTTP Handlers?HTTP handlers are
11 Oct 2013 by ASP.NET Community
ASP.net provides facilities in web.config for specifying error pages when an exception occurs, for example:           
5 Dec 2013 by AsthaS
Hi all,I want to create a post request and send it to server using libCURL can anyone help me in that.If this is my sample request/WCS_Capabilities/Capabilityhow am I suppose to set the xml...
8 Jul 2011 by atticuss187
So, I wrote a JavaScript to grab an xml file from my desktop and display it on an html page. However, I now have added my xml file to a webserver (mongoose). I want to call the file from that server, but whenever I call the file from the server it dosen't work, but when I call it from my desktop...
8 Apr 2019 by AtulSharma609
Hello can anyone help me do this , i do not know PHP and i have to do this in asp.net c# function sign_ipn($reply, $token) { ksort($reply); $flat_reply = ""; foreach ($reply as $key=>$value) { $flat_reply = $flat_reply."$key=$value&"; } $flat_reply =...
8 Apr 2019 by AtulSharma609
private void getResponce() { string requestJson = string.Empty; using (StreamReader reader = new StreamReader(System.Web.HttpContext.Current.Request.InputStream)) { requestJson = reader.ReadToEnd(); string returnUrl =...
9 Feb 2013 by atunahkur
Hello world, I would need help for programming Web (HTTP) Server. But I have no ideas where to start...What language should I use (C# or VB.NET)? Can someone make an example???...Application should be GUI type, not some console application.hope You understood what I ment...
15 Jun 2013 by atunahkur
Hi,I'm trying to write a piece of code to save client uploaded file to server's path.Code is:try{ MessageBox.Show("POST Request!"); HttpFileCollection uploadedFiles = HttpContext.Current.Request.Files; //I detected that the error is caused in this line. Error is:...
2 Dec 2013 by austinbox
If you are using a WebBrowser control then the links can be found in the HtmlDocument.Here is some example code//Make sure document is loadedprivate void WebBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e){ HtmlElementCollection links =...
6 Apr 2018 by Awadhesh Maurya
I want to download text file which is in remote server. If I use wget or curl -O to download sometimes it put html code inside downloaded text file. For example if text file name is text.txt which contain a line "hello world" by using- wget wget http://url/text.txt or curl -O...
7 Mar 2012 by AZ Rescuer
I have few issues in decompressing gzipped http response, I separated data part from headers but its gzip header and message contain \0 characters due to which there is problem in copying gzipped data. I've used libcurl but it is relatively slower than C sockets.Here is some part of a...
7 Mar 2012 by AZ Rescuer
Problem solved ! memcpy() was copying \0 chars but eclipse debugger was not showing entire gzip chunk and was breaking at \0. Updated the above code.
18 Apr 2013 by Azad R Chouhan
Hello friends Good Morning I am facing a problem from last few days.. I have a window application which is sending request to another applications and it get the response from other application.Now the problem is this that if i run my application in any another system i will get the...
15 Jun 2021 by Azad R Chouhan
Hello everyone I am posting the same question again. Because i did not get any reply from my previous question.I am working on an application. Its a window application which developed in .net 2.0Now the problem is this that when ever i run my application and i send a request to another...
25 Apr 2013 by Azad R Chouhan
I use fidler on machine in which the application is running and add this code in app config Its working then but when i exit the fidler then its give me error what is the reason please tell me
21 Dec 2021 by AzeeM_R
I have http response wrapper that rewrite response and suppose to send response like below {"Version":"1.0.0.0","StatusCode":200,"Message":"Success","Result":[{"code":"465","name":"fasdfsdfsd","systemkey":"AAAAAACL","createdby":"RM ...
11 Dec 2022 by AzeeM_R
1 Hi I want to create middleware for Asp.net core to wrap http response that returns response like below { { "count":1,"timestamp":"2021-12-18T01:13:41.2985038+05:00", "status":"Success", "results":[ {...
12 Mar 2014 by B. Clay Shannon
My code is perfect (AFAIK), but it's not passing along the body data in the HttpWebRequest: string uri = string.Format("http://192.168.125.50:28642/api/DeliveryItems/PostArgsAndXMLFileAsStr?serialNum={0}&siteNum={1}", serNum, siteNum); SendXMLFile(fullXMLFilePath, uri); ...
31 Dec 2015 by B. Clay Shannon
I have the following Controller code: namespace PlatypusReports.Controllers { [RoutePrefix("api/platypus")] public class PlatypusController : ApiController { [Route("{unit}/{begindate}")] [HttpPost] public void...
10 Feb 2015 by BacchusBeale
There are several options but depend on the requirements of your project.1. TcpListener and TcpClient2. At lower level Client Socket and Server Socket3. Web Service and SOAP client with method stubs generated by wsdl tool from Visual Studio4. WCF5. Windows Service with IP and port...
17 Jan 2011 by Bart Viaene
I'm involved in a large J2EE project replacing legacy FORTRAN90 and COBOL back-office applications with a SOA system.I need a PoC for making calls to the new Java services on the ESB from within existing FORTRAN90 applications (which are not replaced but certain functions need to be...
4 Nov 2011 by Be Yourself
Most of the time My jsp page on the server is showing the following error:Error: Could not get markup. The cookie or session is invalid or there is a runtime exception. I am unable to trace out the exact issue why it is caused .I guess it is because of the time out period set for the...
12 Oct 2013 by behish
hi I upload my site but this problem occures :HTTP Error 500.19 - Internal Server ErrorThe requested page cannot be accessed because the related configuration data for the page is invalid.Detailed Error Information:Module IIS Web CoreNotification UnknownHandler Not yet...
1 Jun 2021 by Ben Zimmer
So this is the popup that I'm referencing: https://i.stack.imgur.com/w0Abz.png Everything is working completely fine except this one pop up which I can’t bypass. Here is the code I'm using to connect to the url public void...
15 May 2012 by Bernhard Hiller
In the era before Google, there were several search engines in use which hardly anyone knows today (Altavista, WebCrawler, ...). The workflow you describe corresponds to a "metacrawler": it sends the request to several search engines, and displays all of the results. According to Wikipedia...
24 Apr 2013 by Bernhard Hiller
"But its give me this error for only one url and for anothers url its working well" - that's the important point. Which URL is it? Does the URL work when you use it from a common web browser (e.g. Internet Explorer)? When the server decides to close the connection, you'll get an error in your...
11 Nov 2014 by Bheem Sen Singh
Before the creation we nedd to Grant permision to following system object under desired sqlserver user.sp_OASetPropertysp_OAMethodsp_OAGetErrorInfosp_OADestroysp_OAStopsp_OACreatesp_OAGetPropertySqlserver Stored ProcedureCreate procedure [dbo].[HTTP_DB_ALERT]( @sUrl...
12 Oct 2013 by bjdestiny
Looks like the user account you're using for your app pool doesn't have rights to the web site directory, so it can't read config from there. Check the app pool and see what user it is configured to run as. Check the directory and see if that user has appropriate rights to it. While you're at...