Episode #125 of the Stack Overflow podcast is here. We talk Tilde Club and mechanical keyboards. 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
6
votes
1answer
152 views

Reading and returning the HTML content from a specified URL

I wanted to create a simple function that can read and return the HTML content from a specified URL. This is what reading here and there lead me to: ...
3
votes
1answer
106 views

HTTP Load test with Golang

I am a golang novice... I am trying to write an application that takes in many requests - up to a sustained 10000 HTTP posts/sec and post the payload to two back-ends in parallel (5 second timeout). ...
4
votes
2answers
270 views

Fetching data through HTTP and caching JSON result in a file

The task is to fetch some JSON data from an API with a GET request. If the location is not available for any reason, read a cache file. Otherwise write the cache file for future use. The following ...
1
vote
2answers
374 views

Python functions to fetch spreadsheets through SFTP and from Dropbox [closed]

I have written two functions- first one is to read files from SFTP and second one is to read files from Dropbox. Both functions have some similar line of code like validating extension and reading/...
3
votes
1answer
454 views

Measure website home page total network size in bytes

We have a requirement to check the size of some of our website home pages, in MB. This is to ensure that they are not growing too large, and that large images haven't been uploaded. I couldn't find ...
2
votes
1answer
102 views

PHP Template: Image file upload handler

I'm trying to develop some templates for common PHP tasks I've been dealing with. One of which is a general image file upload handler. So far I'm using the following reusable code which seems to be ...
3
votes
1answer
4k views

Simple server using async and HttpListener

I have a program that controls a custom machine. I wanted to add some simple HTTP comms so I could control it from the network or other programs. My server class is: ...
2
votes
1answer
824 views

Implementation of an OkHttp singleton for Android

I'm new to Android programming. I am going to make lots of HTTP requests: 500, 1k, 2k, 10k. I have tried to create a singleton class for OkHttp. I wrote this: ...
5
votes
1answer
88 views

Web page downloader that supports redirects

I wrote a class that downloads the HTML of a page from the internet. This class also manages redirects. This works well but I'm not very satisfied about time management for slower servers. In fact, if ...
3
votes
1answer
80 views

Construct and send an HTTP get request from scratch and print all the received data to the screen

My concerns: Is the code pythonic? Does the receive_all function make the code any cleaner or should that functionally be apart of the ...
3
votes
1answer
117 views

Issue tokens concurrently with synchronization per client

I have an API application with token authorization. A token is valid for one hour. Each business client has its own instance of the API application: ...
5
votes
1answer
65 views

WebExtensions add-on for highlighting insecure links

My first Firefox add-on (WebExtensions compatible, so it works without modification in at least Chromium) puts a red border around insecure links, including plain HTTP links and links with a ...
5
votes
2answers
753 views

Customizing errors based on HTTP status code in golang

I want to collect errors and its causes by defining custom errors (HTTP status 40x & 50x). For example, if user's request was bad, I want more specific reasons for the error. A customized error ...
3
votes
1answer
35 views

Handling download requests using PM2

I Using Nodejs v9.10.1 for handle download operation from another application. When using PM2 in fork mode to make alive my code. After 50 minutes, this will show high memory usage. Server Config is ...
3
votes
0answers
355 views

Making 10000 HTTP requests as fast as possible

I need a program that needs to gather data from large list of API end points. Below is a mock-up program that attempts to make 10000 requests as fast as possible. Any suggestions on how to improve on ...
4
votes
1answer
778 views

Testing validity of Proxy servers concurrently

I am trying to test the validity of a few thousand public proxy servers quickly. To do this, I am sending web requests using each proxy to a website such as example.com, and checking that no errors ...
3
votes
1answer
56 views

Creating a Basic Success Function for Http

I got sick of every time I make an Http request validating that the response was a success. I did a lot of: if response.class == Net::HTTPOK or ...
3
votes
1answer
487 views

Asynchronous file upload to disk

I have a simple webserver written in Python using aiohttp. My goal is a server that can receive many file uploads simultaneously and stream them all to disk. This ...
6
votes
3answers
2k views

Creating HTTP proxies for services

I have a HTTP client factory that creates a separate HTTP proxy instance for each of my services - which are in the cloud. The factory creates each instance on the basis of an interface which the ...
1
vote
0answers
38 views

HTTP request call for a token

The following code seems to have several redundant Flush, Close and Abort statements despite ...
3
votes
0answers
27 views

Testing whether pages can be fetched from two ports

I have an endpoint in my API which does a port test on 4455 and 4456 once a client GET's it. This is accomplished by requesting two web pages. The result will respond to the client with a JSON object: ...
3
votes
2answers
8k views

HTTP request parser in C

I'm implementing a simple HTTP server in C, and this is the first part of it. Basically, it takes a string containing a "raw" HTTP request, and parse it into a ...
1
vote
1answer
294 views

HTTP download with dynamic reallocation and retries

This code is for downloading a file via winhttp lib, It's invoked by StartDownload function which tries to download n times before returning false if maximum tries ...
2
votes
0answers
37 views

Undocumented API client / wrapper in Python

Got the go ahead to make an API wrapper for an undocumented web API. Hoping to get some feedback on my code and design choice. I've been going back and forth and haven't been able to really feel ...
10
votes
1answer
160 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 ...
7
votes
2answers
625 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 ...
5
votes
1answer
222 views

Go web application with a mock user repository

I'm new to go and struggling to create structure of web application. I read about clean architecture and Ben Johnsons blog post about package layout. Now i want to put it all together. This is just ...
2
votes
0answers
1k views

RXJS queue up multiple http requests and send when x conditions happens

Just started to use rxjs few weeks ago, I think I'm getting most of it right, but my code seems to be not that efficient and prone to bugs I haven't run into yet! I need to be able to send http ...
1
vote
1answer
156 views

Call URL x times where x is in the JSON response after the first call

I have to make an HTTP POST request by passing header and body. In the body, I need to provide a pageNumber before posting data so I am starting with "1" initially. ...
4
votes
0answers
772 views

Downloading images from Reddit using Python 3

I have been working on this small project in order to fetch top-notch images from Reddit. Overall I am pretty confident about the code below but I am not entirely sure about whether my error handling ...
10
votes
1answer
154 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 ...
0
votes
1answer
67 views

Haskell Servant - login endpoint with two error states

Here is one a handler for dealing with logins, I've recently refactored it to try and make dealing with the different error cases a bit more elegant, though I still think there is room for improvement:...
2
votes
1answer
79 views

AngularJS - Making Factory and Controllers DRY

The following code works, but: The service makes multiple API calls, the functions are very similar with a lot of code duplication. The same is true for the controllers- very similar code with only ...
5
votes
1answer
96 views

Download and concatenate text files from multiple API endpoints

Background Chronicling America is an archive of digitized US newspapers hosted by the Library of Congress. The site allows programmatic access of its resources through an API, one part of which is ...
2
votes
0answers
1k views

Java Socket Proxy

I've been messing around with protocol handlers in Java, going so far as to write my own using a custom URLStreamHandler and ...
1
vote
0answers
1k views

HTTP PATCH method for WebAPI

I'm working on an implementation of the HTTP PATCH method for WebAPI. I know there are packages like JsonPatch and OData Delta for that, but they don’t work for me. JsonPatch is too complicated and ...
2
votes
1answer
358 views

Making currency rate requests in Java with CompletableFuture

here is my code to get quotes for forex pairs, using the CurrencyLayer API, with CompletableFuture. We do an HTTP GET, parse the JSON response and map it into my data structures (see sample output at ...
2
votes
1answer
484 views

Writing an HTTP POST body that has new lines

I am looking for general ways to simplify this. What it does is write a body and send an HTTP POST request to an endpoint. I had the method require a list just to append new lines for each string I ...
3
votes
2answers
3k views

Timeout implementation of fetch

After doing some research on google i didn't find any good info on how to implement timeout with fetch (looks like there are multiple proposals but that's about it so nothing has implemented it). For ...
3
votes
1answer
2k views

Golang HTTP request retry code

I believe that clean and elegant retry code is notoriously difficult, so I'm wondering how the following code could be improved. The retryGet function should have ...
1
vote
1answer
53 views

error management when parsing multiple floats

I am writing a handler to render a GIF of a Lorentz attractor. I need to parse floating point numbers from the some querystrings attached to the GIF path. If any of them are bad, I need to log an ...
4
votes
3answers
94 views

A Swiss Army like module for dealing with HTTP and URLs

I code a lot of web crawlers and web scrapers and I find myself writing the same functions over and over again. I also find myself having to come to Stack Overflow and find the answer to a question I ...
-1
votes
1answer
442 views

Downloading images using a thread pool, with exception handling

I'm currently using a broad Exception handler in my code and I would like to remove this broad exception. Which exceptions should I handle? Are these exceptions generated in my function "func" or ...
7
votes
0answers
716 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
1answer
580 views

Submit form data to server side

I have this method here called SubmitProc which submits form data that the user filled out to the server side and does a check if the response to the server goes through. If it's fine, great. If not, ...
4
votes
2answers
2k views

Python proxy checker/scanner

Here is my attempt at a simple HTTP proxy scanner/checker. I've been learning python for about 6 months now and decided to move beyond simple scripts and data scrapers. I think the code looks messy ...
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 ...
7
votes
1answer
147 views

BingWallpapers: Fetches and applies the image of the day from Bing as the wallpaper

I have written a small desktop program nabeelomer/BingWallpapers in Haskell. This is my first time writing Haskell. I was wondering how I can make the code use more functional programming features/...
3
votes
1answer
172 views

Get external IP and update ddns service

I've created a cli application that consists of a package with 2 functions. One to get the external ip address, and another function to update a dynamic dns record at dns.he.net. Both are then used in ...
1
vote
0answers
77 views

Fetch value from website using cURL

I want to make a http request, get the website content and check one specific element. Currently I'm doing it with lcurl (got explanations from a tutorial). Here is an excerpt of my code: ...