Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [http]

HyperText Transfer Protocol (HTTP) is an application level network protocol used for the transfer of content on the World Wide Web.

Filter by
Sorted by
Tagged with
47
votes
2answers
69k views

Single instance of reusable HttpClient

I've got this method and I realize that an instance of HttpClass is going to be created for each call to it. While working seemingly OK, I'm considering moving it ...
26
votes
3answers
44k views

HTTP Client requests done right

As advised by many, I am using a client pool - specifically the Apache PoolingHttpClientConnectionManager. For simplicity I wrap it in my own simple singleton class. Sorry about the rather OTT ...
20
votes
3answers
3k views

Simple webserver in C

My first learning project in C. Looking for general feedback e.g. gotchas, coding standards, formatting, naming etc. I'm here to learn! webserver.h ...
16
votes
1answer
1k views

Simple xkcd comic downloader

I'd really appreciate some harsh/constructive criticism of what I would consider as my first program in Haskell. The program should download all of the xkcd comics into a folder in the current ...
15
votes
4answers
2k views

How to shorten this terrible HTTP header parser?

I am trying to read a line ending in \r\n from a Handle. This is an HTTP header. I’m fairly new to functional programming, so I ...
14
votes
3answers
2k views

Simple HTTP Server

I'm working on a project (studying) and I have a lot of time for proof of concepts and write something from scratch. Basically I'm creating an HTTP server (simple, but not too simple) in C++ using ...
14
votes
2answers
14k views

HTTP server and multi-threading optimization

I wrote an HTTP server for the management of scores for users and levels. It can return the highest score per level. It has a simple login with session-key. What do you think could be improved in ...
14
votes
1answer
19k views

Golang HTTP status checker

I'm writing my first somewhat production ready (or not) Go program and could do with some feedback from someone more experienced with go. The code reads a list of URLs from a JSON file and then makes ...
13
votes
3answers
1k views

Was this shell script ready for open-source? (Random XKCD wallpaper)

I wrote the following little shell script and published it on GitHub. In the repo there's also a README file that explains how to use it in more detail. This is the first time I open-sourced/...
13
votes
1answer
2k views

Stream that opens an HTTP GET and then acts like a normal C++ istream

Needed a quick stream to get JSON objects. ...
13
votes
1answer
11k views

HTTP request and HTTP client abstractions

I am trying to make an OOP abstraction for a very simple HTTP client. I have also created a simple abstraction for a (GET only for now) HTTP request. I am using ...
12
votes
2answers
150 views

HTTP C++ Implementation

this is the first time I've requested a code review. I'm writing a piece of software in C++ that will use HTTP for communication. I wanted to do it myself to learn and then have someone review it and ...
11
votes
3answers
546 views

Exception handling, et al - How do I make this web downloader not “poor”?

I haven't done Java coding in years, but I thought I would give it a shot for a job interview. I have a few questions: Why is this error handling considered poor? How am I supposed to be doing it? ...
11
votes
2answers
3k views

Async wrapper around public API

Tear it apart. I'm mostly concerned around the appropriate use of ConfigureAwait(false), and possible poor handling and duplication of the ...
11
votes
1answer
468 views

Modifying HTTP headers in a piped stream

Note: This is the first time I've written anything whatsoever in straight C. In other words: I have no idea what I'm doing. I recently had a task that involved temporarily relaying responses from one ...
11
votes
2answers
7k views

Efficiently using Apache HttpClient in multithreaded environment

I have a library which is being used by customers and they are passing DataRequest object which has userid, various ...
10
votes
5answers
4k views

Resumable HTTP download class

Any suggestions, corrections and advice would be very nice and much appreciated. ...
10
votes
2answers
581 views

Parsing an XML File for a single word/phrase

this is a small part of my code that allows me to request a file through a load balancer, reading this XML file gives me the server's name (only node inside the XML Document) if the machine isn't ...
10
votes
1answer
7k views

Faster Django CSV generation for several million database entries

I am writing a CSV file generator that's filtering through about seven million database entries (MySQL backend). This part is especially slow and I was wondering if there is a way to make it much ...
10
votes
4answers
6k views

Persistent cookie support using Volley and HttpUrlConnection

I need to add support for persistent cookies on an Android app that I'm building for Authentication/Authorization. This app uses Volley for making HTTP requests and its ...
10
votes
2answers
3k views

Parse HTTP header using Python and tcpflow

I wrote a program that reads a pcap file and parses the HTTP traffic in the pcap to generate a dictionary that contains HTTP headers for each request and response in this pcap. My code does the ...
10
votes
1answer
942 views

HTTP request reader

I'm working on a proxy service that will run on top of a Java application in order to manipulate some headers. I've just completed the first step and that is intercepting the request message and ...
10
votes
1answer
158 views

Point to point file transfer through HTTP socket

Why did I write this code This has a fun cartoon describing the problem of file transfer nowadays. And it's utterly true. There are already some webRTC based P2P file transfer services online. But I ...
10
votes
1answer
161 views

Merging JSON and inserting into the DOM

I'm an aspiring junior dev. This is modified version of the code I wrote for a technical interview I did today (Didn't pass. Sad.). The problem was to fetch two json files, and display their data on a ...
10
votes
1answer
405 views

HTTP Stream Part 2 A stream that opens an HTTP GET and then acts like a normal C++ istream

The review I asked for yesterday was for a header only library. Stream that opens an HTTP GET and then acts like a normal C++ istream This has some limitations as it downloads all the data as part of ...
10
votes
1answer
4k views

Node.js parallel file download, the ES6 way

I wrote a script that downloads all PDFs found on the web page of a particular government agency. I would have chosen bash for such a task, but I want the script to ...
9
votes
2answers
2k views

Non-blocking, non-threaded HTTP client implementation

This is a C# WinForms program targeting .Net 4.5. I am using it for a movie organizer application that will contact sites like OMDB, MyApiFilms, etc. for data about the movies. At the main application ...
9
votes
1answer
134 views

Flight API querier

I am learning Go and wrote a small application that queries the Skyscanner API as my first attempt at learning. I was hoping someone more expert than me in the language could look over it at broad ...
8
votes
5answers
727 views

Checking URL validity

This is sort of a follow up to a previous question (Do I have any SQL leaks?). I have changed some things around and am working on a solution where I use Active Directory to gather information about ...
8
votes
1answer
6k views

Refactoring a Crawler

I've recently ported an old project and made it object-oriented. However, I've noticed that rubocop points out the following status: ...
8
votes
3answers
44k views

HttpURLConnection response code handling

This snippet from a downloader callable handles HTTP status codes. I need critique on both the style (for or do-while loop ...
8
votes
1answer
2k views

Increase download speed of code

I am making a download manager and in Java. My code is currently working and downloads at 430-450 kb/s. The same file, when downloaded using downthemall, gives 440-460 speed, and when using an ...
8
votes
3answers
815 views

Soundcloud to CSV File

This program connects to Soundcloud and turns the supplied username into a CSV file with the user's like list. The code accomplishes this although it looks rather messy and was wondering what I could ...
8
votes
1answer
1k views

Scraping GitHub for security vulnerabilities

I haven't done much Python programming, but I really like the language so I've been using it for side projects that I work on. The problem with this is that I don't have the opportunity to have my ...
8
votes
2answers
10k views

Parsing HTTP Headers in C++

I am building a web server from scratch and trying to make certain tasks faster by embedding C code into the mix for performance. Specifically I'm worried about how the ...
8
votes
1answer
5k views

Simple Multi-Threaded Web Server

Need a way to test a web crawler. Threw together this web server that will replay previously saved pages from a real web server. Headers ...
8
votes
2answers
8k views

Retry loop for asynchronous HTTP requests

I've got a method that needs to PUT data to a web API. Sometimes the connection fails, so I needed a way to do retries, but if the retries fail, I still need to capture the exception and re-throw it. ...
8
votes
2answers
294 views

Client Server Stocks application

I was given task to build a client server application, using any technology I want. Here are the requirements To simplify the process the Server would have an in memory stock list and there would be ...
8
votes
1answer
386 views

Download a file and update the current downloaded percentage

I am not a big fan of JS, but have been forced to use it in this situation for various reasons. My task: Download a URL to a target file, and update another part of the application with the current ...
8
votes
1answer
2k views

Questions regarding the use of Requests Futures for accessing REST URLs

This is a much simplified version of the real code focusing just on the handling of Futures from Requests Futures. I have a few questions: I had to implement my own version of ...
7
votes
5answers
6k views

How can I better my URL checker program?

I made a LinkChecker program which checks URLs from a text file and outputs status into another file like this: ...
7
votes
2answers
627 views

Repeatable HTTP requests in Python

I have a simple python script that's repeating a HTTP response/request. I would like to know how I could have constructed this better, particularly if there's a way I could have incorporated the slice ...
7
votes
3answers
2k views

Simplifying asynchronous “executeAsync” method along with “onFailure” callback

I have a system in which user id is "sharded" across all the machines which means each machine is responsible for certain user id data. I am working on a library which will take ...
7
votes
3answers
3k views

Concurrent HTTP request loop

I'm using the rolling curl library to fire HTTP requests for content-length headers of images (we need to know their size to weed out placeholders and low res images). The image URLs are stored in a ...
7
votes
2answers
232 views

Exception handling for HTTP request timer

This method is used to check a URL and return the time it takes to check and the HTTP status code: ...
7
votes
1answer
146 views

Basic Python HTTP Server

It's an extremely simply HTTP server in Python using the socket library, and a few others to get the MIME type, etc... I've also avoided the ../../ vulnerability, ...
7
votes
3answers
1k views

Very basic C++ HTTP Parser

I was bored, so I decided to write a very basic HTTP Request/Response parser in C++. Some Notes: This isn't meant to be a complete implementation of the HTTP protocol This isn't meant to be the ...
7
votes
2answers
4k views

Custom Authentication Attribute

I was trying to find a way to redirect to different pages on authorization and authentication failure. I found this to be a possible solution. However, I ended with a different solution by myself. It ...
7
votes
1answer
264 views

What is better for the code segment, sockets or multiple processes?

I am trying to fetch information out of SHOUTcast for mutiple users at the same time. Here is my current code: ...
7
votes
1answer
4k views

Manually parsing HTTP response header

Due to some constraints I had to manually parse an HTTP response coming out of a stream. I could not use buffered reader or scanner because the perform buffering and end up buffering bytes beyond the ...