Questions tagged [http]

For code that acts as a HTTP client or server.

Filter by
Sorted by
Tagged with
4 votes
1 answer
95 views

Writing a HTTP server in C

Code ...
5 votes
1 answer
3k views

Gracefully shutting down a HttpListener

I have worked out a code for graceful shutdown of a httplistener. However, I am not sure if its foolproof. Below I provide c# code and the powershell (v3.0) scripts I've used to run my tests... C# ...
4 votes
0 answers
106 views

A simple local API proxy

Recently I needed to support someone who wanted to ingest some data from on of our API's but had tooling that struggled with the authentication bit. While I'm sure there are some off-the-shelf ...
2 votes
1 answer
58 views

Reading a date from the start of a text webpage from github to determine if the program is fully updated

...
3 votes
1 answer
159 views

Get HTTP status of many URLs

I'm brand new to using rust, so please bear with me. I'm trying to write a rust program which takes two arguments: A URL, and a wordlist. This wordlist has the following contents, and is several ...
3 votes
1 answer
112 views

HTTP Request-Line parser

I am trying to write an HTTP/1.0 (RFC 1945) parser in C, so I started with the Request-Line. Ideally, the parser should return one of the three: The request is valid. The request is malformed, but ...
5 votes
1 answer
96 views

Small HTTP client/SDK created using libcurl in C language

I created a SDK in C for my Rust project (a key value store in Rust). It should give access to the HTTP routes in a simple manner. (I never worked with C outside of university.) I used: ...
11 votes
2 answers
2k views

Improving the Flask cache decorator

In my rumblings developing flask applications I found the caching decorator. The decorator is a short and well-written piece of code, but I feel like it misses the few points bellow: It only caches ...
1 vote
1 answer
76 views

URL healthcheck script

Task: develop a CLI utility for HTTP Health check at a given URL. The check is performed in a cycle with a specified interval. On each iteration of the HTTP GET activity on the given URL. There are ...
1 vote
0 answers
66 views

Calculate total running time for movie series

Which of these 2 functions is better and more readable and why? (Both functions do the same thing). My goal is to get the total time of a series, using the TMDB API (which has a limit of 20 different ...
1 vote
1 answer
177 views

HTTP routing with Mongoose

I'm trying to extend the Mongoose RESTful server example with URL routing. This code relies on the Mongoose library available here. This is heavily inspired by the routes class from this question but ...
4 votes
2 answers
2k views

Seekable HTTP response stream wrapper

I created this wrapper to use together with HttpClient streams and ZipArchive. ZipArchive ...
4 votes
3 answers
3k views

Parse a GET or POST string in C

This function takes a string from an HTTP POST or GET string, finds the specified variable, and allocates memory for the result and puts it in a string. The destination is given as an address of an ...
5 votes
1 answer
759 views

Golang Tour Web Crawler Exercise

In the last few days I've played around with Go a little and took the language tour. The last exercise (text here) requires you to crawl a graph that simulates a set of Web pages with links, using ...
0 votes
0 answers
50 views

Detecting the content type of a given http body/string

I am trying to detect the content/mime type of a given Buffer/string. In other words, I am trying to guess what on earth is a given string. My approach is somewhat brute-force: ...
3 votes
1 answer
36 views

Open the best Reddit posts with Nim

I wanted to try out the Nim language so I wrote a simple program to retrieve the top \$n\$ messages on a given subreddit in a given time frame and open them in the default browser. I would really ...
5 votes
2 answers
190 views

C++ Socket Part-3

In my ongoing attempts to become a better blog writer I have some written some more code that needs reviewing. Full Source: https://github.com/Loki-Astari/Examples/tree/master/Version3 First Article: ...
0 votes
2 answers
279 views

C++ Socket Part-4

In my ongoing attempts to become a better blog writer I have some written some more code that needs reviewing. Full Source: https://github.com/Loki-Astari/Examples/tree/master/Version4 First Article: ...
3 votes
0 answers
218 views

System to automatically login to my university's Wi-Fi network using HTTP request

What is this? My university's Wi-Fi network requires students to visit a specific URL and login to the network before we can use the actual internet. This project replicates that same process by ...
10 votes
2 answers
8k 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 ...
7 votes
1 answer
1k views

Read quantization tables from JPEG files

I'm developing an application that will hide information inside the quantization tables of JPEG files. It's called DQTsteg, if you want to know more about what I'm attempting to do. Right now I'm ...
2 votes
1 answer
4k views

HttpClient retry handler on response 429

When the remote server returns a 429 (Too Many Requests) response with the Retry-After header, the HttpClient can handle such cases with a handler: ...
11 votes
3 answers
2k views

Multi-threaded web server serving HTML, images, etc

I have a web server that can send websites, images, mp3 and other things and I was wondering how I could improve the code and make the server more efficient. ...
6 votes
2 answers
354 views

PHP readfile() with 304 Not Modified and HTTP 206 Partial Content support: httpreadfile

I wanted a readfile with 304 Not Modified and 206 Partial Content support, I think i got right, but probably spent way more effort on error-checking than worthwhile.. Also I didn't develop it by ...
7 votes
1 answer
336 views

Calling other machines from the LinkedList if one is blocked or down

This is a follow on to : Simplifying asynchronous "executeAsync" method along with "onFailure" callback. I am using AsyncRestTemplate as my <...
2 votes
2 answers
2k views

Get all data from an external and paginated Swagger API using Java / Feign / Spring

I have written the following method that allows me to import from another API all the items stored there using Feign. The only issue is that the external API provides a size limit of 2000 and ...
1 vote
0 answers
49 views

Object to make GET, POST, PUT and DELETE requests

I am trying to build an object that group all methods to make http GET, POST, PUT, DELETE requests with fetch API. I would like to accept objects and formData without having to specify the content ...
5 votes
3 answers
205 views

Python 3 Multi-connection downloader

I have written a fully functional simple command line multi-connection downloader, written in Python 3, using just threading, ...
12 votes
2 answers
4k views

Python script that pulls in and display a random xkcd comic

This script is supposed to download query xkcd json interface, find the total number of comics till date, pick a random number in that range, use the xkcd json interface again to find the comic image ...
0 votes
2 answers
147 views

Python script for Web scraping

I wrote a Python script for Web scraping of a Website. Please review my code and suggest me any changes or make me aware of my blunders/mistakes?. I wrote the almost same script for other websites ...
4 votes
1 answer
203 views

Python program that gets basic information on a Github user

I've created a basic Python CLI script, which takes a Github username, and returns some basic information associated with said username. I use the requests for HTTP requests (I'm new to this area) and ...
5 votes
1 answer
4k views

Python API client

I'm creating a Python API client, after thinking and checking some open source Python clients I created this class, and I'm looking for any feedback (design, best practices...), this is an example URL ...
1 vote
1 answer
4k views

Python requests downloading big files in slower speed than wget

This is a simple toy downloader using python's requests library. I’ve monitored the download process is slower on an ethernet connected box. The realtime speed is ...
7 votes
2 answers
2k 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
1 answer
10k views

Python auth using requests

I am trying to implement a custom ApiClient in Python, using requests. The way it does authentication is by: login(username, password) -> get back a token if valid, http error code if not set the ...
1 vote
2 answers
91 views

HTTP server that evaluates arithmetic expressions

I made a simple web server in C, and I would like to have your opinion on my code quality. This would help me to improve. ...
1 vote
2 answers
95 views

Having trouble deleting multiple queries (PHP, MYSQL)

I'm having trouble making WHERE IN query work, I was only able to make it work as a foreach loop. My payload looks like this: sku[]: BOOK0002 sku[]: BOOK0003 My ...
1 vote
1 answer
2k views

Better ways to parse the Content-Length from the HTTP header

I have a buffer that contains the HTTP header, which contains the Content-Length string indicating how big the file is that needs to be downloaded. I am looking to ...
1 vote
2 answers
102 views

Simple server to host simple website page with css

I have created a simple server that host html that has css. Please make sure if ur testing then change the paths relative to ur system in listhell.c in respond_main(..) function. The html file has to ...
1 vote
1 answer
3k views

Spring boot: better way to handle response and exceptions

I am working on a quite a big Spring Boot web service and I wanted a standardized and simplified way to handle responses and exceptions by following fluent API design. So this is what I did and it ...
3 votes
0 answers
48 views

Node.js Dumbserver

Dumbserver, or the simplest workable HTTP server. It is supposed to operate in the 'traditional' way, that is, mapping paths in requests to the directory structure. Why did I write it: I needed a ...
2 votes
1 answer
431 views

Low performance of HTTP request using Haskell wreq

The program makes HTTP requests (checks video stream status) and calls an external program. ...
2 votes
3 answers
3k views

A C++ library that sends and receives data using HTTPS or HTTP

...
4 votes
0 answers
522 views

Simple RESTful counting API in Golang

Description This is a simple (and hopefully) RESTful API in Golang that uses Redis. I have next to no prior experience in Golang and absolutely no prior experience with Redis. The API is a simple ...
4 votes
2 answers
996 views

Telegram Bot that retrieves book information from GoodReads

The project below is about a Telegram bot that implements both inline and offline modes. The idea is to get a brief info about a book, searched by title(it's author, rating, short description). I ...
2 votes
1 answer
1k views

The Telegram bot for book information

Telegram Bot that retrieves book information from GoodReads I've created a Telegram bot that implements the inline/offline modes to get the brief info about a book, searched by title(inline mode) or ...
1 vote
2 answers
710 views

Find if cookie name exists in the cookie string

I need to determine whether a cookie name is available or not in the cookie string. I have achieved this. We could use the cookie-parser package but I don't want to use that package so I have written ...
8 votes
3 answers
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 ...
1 vote
1 answer
279 views

A simple wrapper around fetch

I am writing a simple wrapper around fetch. ...
0 votes
1 answer
110 views

Go Web API for Sending Emails via Contact Form

I've been playing around with Go and finally found a use case for a little web service I could build. It takes JSON data via an HTTP POST request and sends me an email via Mailgun's API (it's used for ...

1
2 3 4 5
9