Questions tagged [http]
For code that acts as a HTTP client or server.
407
questions
3
votes
1
answer
142
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
93
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
86
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:
...
1
vote
1
answer
72
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
56
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
114
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 ...
0
votes
0
answers
34
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
35
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 ...
3
votes
0
answers
159
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 ...
2
votes
1
answer
3k
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:
...
6
votes
2
answers
335
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 ...
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 ...
0
votes
0
answers
43
views
Does this HTTP library API make sense for handling small in-memory message bodies as well as large stream-based messages?
I'm writing a HTTP server and client in C++20. It started with a simple API, string call(string url) which worked great for another project. The API uses implicit ...
12
votes
2
answers
3k
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
139
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 ...
1
vote
2
answers
89
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 ...
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.
...
1
vote
2
answers
96
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 ...
0
votes
1
answer
2k
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 ...
5
votes
3
answers
186
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, ...
3
votes
0
answers
46
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
3
answers
3k
views
4
votes
0
answers
482
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 ...
1
vote
1
answer
249
views
A simple wrapper around fetch
I am writing a simple wrapper around fetch.
...
0
votes
1
answer
101
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 ...
2
votes
2
answers
293
views
Getting metadata from MusicBrainz service
I've written a program which does the following things:
calls third-party utility to get mp3 file fingerprint
asks MusicBrainz IDs from AcoustID service
asks metadata from MusicBrainz for each ID
I'...
1
vote
0
answers
261
views
Command line utility for user data migration from MUBI.com to letterboxd.com
Please make code review for command line utility for user data migration from MUBI.com to letterboxd.com.
Utility makes Get HTTP request downloads json-data, parses it and saves as CSV-file.
Can be ...
1
vote
3
answers
6k
views
C# Asp.net core middleware for redirecting URLs
I wrote a small middleware for redirecting between WWW URLs.
The most important thing that I want to change is to make it super fast.
Here's what it is doing:
If the host is localhost or mywebsite.com ...
2
votes
1
answer
398
views
Modify original JSON few times and post http request
Follow up question from here.
I am working on a project where I need to do below things in Python:
Take few input parameters like - environmentName, ...
1
vote
1
answer
110
views
Simple http helper in Go
Can you please share your thoughts on the following simple httphelper in Go? Thanks in advance.
I mainly would like to know whether returning a channel of a custom type seems like a good idea and if ...
8
votes
1
answer
280
views
Post json using http and verify whether all actions completed successfully or not
I am working on a project where I need to work with http apis and call them using Python language. Below is what I need to do:
Take few input parameters like - <...
2
votes
0
answers
50
views
HTTP Client Skeleton [closed]
I've made a simple winhttp client in C++ and here is kind've the skeleton of the header file. I was thinking of initializing the session once and then using it throughout the rest of my http client ...
4
votes
1
answer
987
views
URL parser in C
Title should be self-explenatory. This is a simple URL parser I wrote in C. The function takes a URL from the user and produces a struct that contains the information that can be used to request the ...
8
votes
2
answers
283
views
Serving a webpage that displays the HTTP request information sent by the client
In order to learn web server programming in Node and JavaScript, I decided to implement a simple web server that only does one thing:
Display data of the HTTP request as an HTML table.
The actual ...
4
votes
2
answers
164
views
Minimal, very simple, implementation of an HTTP server for static content, using only core node.js modules
To practice the very basics of node back-end, I'm implementing the most basic server possible for static content, using only the core node modules:
http
fs
path
With the following server ...
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 ...
4
votes
0
answers
1k
views
Parsing HTTP request for webserver implementation
I'm writing a web server from scratch on pure Java in learning purpose. As a part of request handling, I worked on a class to parse HTTP request, I expect from it to be able to do next things:
...
2
votes
1
answer
102
views
Part 2: Create or update record via HTTP request
This script was previously reviewed here: Part 1: Create or update record via HTTP request
I've made the changes that were suggested by @Reinderien.
Now that the code has been significantly refactored,...
5
votes
1
answer
349
views
Part 1: Create or update record via HTTP request
Update:
This is an older version of the question/script. The new version can be found here: Part 2: Create or update record via HTTP request
I have an external system that sends an HTTP request to a ...
2
votes
1
answer
1k
views
Part 2: Send HTTP request for each row in Excel table
This script was previously reviewed here: Send HTTP request for each row in Excel table (Part 1)
I've made the changes that were suggested in the Code Review answers as well as added a few of my own.
...
7
votes
2
answers
4k
views
Part 1: Send HTTP request for each row in Excel table
Update:
This is an older version of the question/script. The new version can be found here: Part 2: Send HTTP request for each row in Excel table
I have an Excel spreadsheet where users can batch-...
2
votes
1
answer
2k
views
Deserialise Json and Read Stream twice in C#
So this is a modern implementation of a HTTP client, trying to find a way to optimise/simplify this.
Specifically the DeserializeAsync method with the GetStream and the compiler statement for if/debug ...
1
vote
1
answer
50
views
Promise-based HTTP abstraction layer
I am currently working in a project based on a microservices architecture pattern.
Services are wired up by HTTP calls. They eventually call each others for fetching or putting some data.
I am ...
2
votes
0
answers
48
views
Proxy server performance improvements?
fairly new to playing around with proxy servers. Wrote a really simple one with Express to help keep some API keys secret so that my front-end app can query the GitHub API. Definitely feels a bit ...
6
votes
2
answers
171
views
Quickly throwing together a text-and-button-based client-server web game
With much of the world in lockdown at the moment, my friends and I wanted a way to play our favourite game, Celebrity, over video chat.
This seemed like a fun coding project, so I put together a ...
5
votes
2
answers
1k
views
OOP Web-scraper w/ Python and BeautifulSoup
This is my first major web scraping program in python. My code works nonetheless, I'm just not sure if it's the best OOP design. My code is below:
...
0
votes
1
answer
87
views
Python code for checking request headers [closed]
I am trying to validate a HTTP REST API request in my python code. It checks for some request headers (X-Foo and X-Bar) and two ...
3
votes
1
answer
81
views
Handle HTTP and BLE requests
Im implementing and designing a workflow that performs both HTTP and BLE requests.
Im having trouble figuring out the best approach to design a service to handle both types of requests, and manage ...
-1
votes
1
answer
353
views
http router written in Golang
in my jurney to learn Go, I decided to write a simple router which I called it Gouter, which I think it has most of the features in gorilla/mux but in my opinion it's easier to use. Anyway, it ...