20 votes
Accepted

Multi-threaded web server serving HTML, images, etc

Calling strcat in a loop is inefficient The function strcat works the following way: It must first search the entire destination ...
Andreas Wenzel's user avatar
18 votes
Accepted

Python script that pulls in and display a random xkcd comic

Xkcd as a class isn't particularly well-named: you're actually representing a "site", "session" or "downloader", distinct from an ...
Reinderien's user avatar
  • 61.9k
13 votes
Accepted

Creating HTTP proxies for services

Create a strategy to find the mapped implementation of the interface provided: ...
Nkosi's user avatar
  • 3,236
10 votes
Accepted

Repeatable HTTP requests in Python

If you are making many requests, it is worth it to have a look at requests.Session. This re-uses the connection to the server for subsequent requests (and also the ...
Graipher's user avatar
  • 40.9k
10 votes
Accepted

Simple HTTP Server

Note: This review focuses on the use of C++, rather than the functionality. Naming: IMHO, the use of "do" at the start of function names is unnecessary and makes the code harder to read. The names ...
user673679's user avatar
  • 11.7k
10 votes

Python script that pulls in and display a random xkcd comic

The use of a class here is basically strictly a bad idea. This is such a simple script that if I were actually writing it, I would probably just put all the code under ...
Jack M's user avatar
  • 404
9 votes

Download Images as fast as possible

Just a few quick remarks (for now): vbNullString is a remnant of VB6 (which I think would be under the ...
Mathieu Guindon's user avatar
9 votes
Accepted

Basic Python HTTP Server

ServerSocket self.handler The handler evaluation in __init__ can be accomplished with an or ternary operation. It's clearer to ...
C.Nivs's user avatar
  • 2,947
8 votes
Accepted

Reading and returning the HTML content from a specified URL

There are a couple of minor technical issues: The content variable is unnecessary, because you can simply return ...
janos's user avatar
  • 111k
7 votes

Golang concurrent HTTP request

Inside SendRequst you are calling SendRequest again, which will make your stack full of recursive calls.
Ahmed Kamal's user avatar
7 votes
Accepted

Scraping GitHub for security vulnerabilities

PEP8 - click, read, apply PEP8 gives coding conventions for the Python code comprising the standard library in the main Python distribution you should use 4 spaces per indentation level function ...
Grajdeanu Alex's user avatar
7 votes
Accepted

Simple Rust Webserver

Learn to love rustfmt: Spaces go between comma-separated items: -use std::io::{Read, Write,BufReader, BufRead}; +use std::io::{Read, Write, BufReader, BufRead}; ...
Shepmaster's user avatar
  • 8,638
7 votes

Repeatable HTTP requests in Python

I'll start with the obvious: while submissions > 0: ... submissions -= 1 can be transformed into: ...
Cristian Lupascu's user avatar
7 votes

HttpClient reusable instance for simple calls on another methods

Dispose Strategy It seems your class doesn't even need to implement IDisposable. Should dispose HttpClient? Single Responsibility I would extract configuration ...
dfhwze's user avatar
  • 13.9k
7 votes
Accepted

OOP Web-scraper w/ Python and BeautifulSoup

Bugs Lines 32 and 42: for titles, info in zip(self, titles, self.comicinfo): for dol_amount in comic_prices: both have unresolved variable ...
Reinderien's user avatar
  • 61.9k
7 votes

Multi-threaded web server serving HTML, images, etc

I didn't read the whole code thing, just looked at some parts. Also, Andreas already mentioned some of the major things, like making one system call per byte being a performance disaster. Some of ...
Peter Cordes's user avatar
  • 3,346
7 votes
Accepted

HttpClient retry handler on response 429

Let me suggest here an alternative solution, namely the Polly's retry policy. This library is the Microsoft suggested way to decorate any HttpClients (normal, named,...
Peter Csala's user avatar
  • 8,990
6 votes
Accepted

Two HTTP notification methods

In such cases I try to move repeated code to separate method that accepts block. ...
Sergii K's user avatar
  • 666
6 votes
Accepted

Simple Multi-Threaded Web Server

First of all, I really liked your C++ code and even though I am not a professional I think there are some points to consider. To the future! It is 2016 so I would say we can safely use C++11 today (...
henje's user avatar
  • 342
6 votes
Accepted

HTTP downloader using Beast

Missing Headers Before going any further, the current code is missing a few headers that it needs, namely: <functional> and ...
D. Jurcau's user avatar
  • 3,010
6 votes
Accepted

Tokenizing texts from Gutenberg archive for analysis

This is the ideal place for a class. Each book is its own object with its own method of returning its tokens. I would make a method tokens, which I would make a ...
Graipher's user avatar
  • 40.9k
6 votes
Accepted

Web page downloader that supports redirects

HttpClient and associated classes provide most of the desired behavior. HttpClientHandler already has the ability to follow ...
Nkosi's user avatar
  • 3,236
6 votes

Very basic C++ HTTP Parser

General Comments: This does not compile for me: if (method == to_string(Method::GET)) ^^^^^^^^^ Is this supposed to be ...
Martin York's user avatar
6 votes

Simple HTTP Server

It's not bad code for someone new to C++. Here are some observations and suggestions that may help you improve your code. Avoid relative paths in #includes ...
Edward's user avatar
  • 66.4k
5 votes
Accepted

Asynchronous lookup over HTTP and checking the status

I suggest to remove the result variable. You can just return the result. You don't have to store it in a temporary variable: ...
lex82's user avatar
  • 1,157
5 votes
Accepted

File downloader using Java, multithreading and HTTP Range request

Naming convention, access level and exception handling Java's naming convention do not follow the hungarian notation and thus do not include a leading m for ...
Roman Vottner's user avatar
5 votes

Internet Speed Calculator

Your whole function get_seconds is not needed at all. You can use the function time.time(), which gives you the seconds since ...
Graipher's user avatar
  • 40.9k
5 votes

Generic WebRequest Method for .PCL

Thing that makes me more perplex is error-handling. First of all you're catching all exceptions, it may hide subtle bugs unrelated to web request itself (for example wrong parameters you supply in ...
Adriano Repetti's user avatar
5 votes

HTTP redirects after login, registration, and logout

Your RedirectInterface type doesn't redirect. It's just a URL builder. Either the name should be changed to reflect that, or ...
cHao's user avatar
  • 3,152
5 votes
Accepted

Point to point file transfer through HTTP socket

Types Nice use of typedef with struct. But try not to add _t endings to your type names. ...
sineemore's user avatar
  • 1,785

Only top scored, non community-wiki answers of a minimum length are eligible