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
3
votes
1answer
24k views

Sending a HttpRequest Message, and retrying in case of unauthorised

This code simply sends a HttpRequest message and, if it comes back Unauthorized, gets a new login and tries again. This code is meant to deal with the moment a ...
3
votes
2answers
789 views

Cookie wrapper in MVC4

I'd like to create a cookie wrapper in my application to help support a DRY approach to coding common cookie methods, provide IntelliSense for cookie-type properties (keys), and protect against typo-...
3
votes
1answer
17k views

HTTP URL validating

What do you think about this? ...
3
votes
1answer
48 views

PHP remote upload security

I need to upload images to a remote HTTP server from a local script. The image name format is {32-char MD5}.jpg. Server directory format is ...
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: ...
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 ...
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 ...
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 ...
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 ...
3
votes
1answer
109 views

Link checker using Go channels

I've started to learn Golang and channels in it. I decided to write simple application - recursive link checker. Given some URL it tries to retrieve pages, parses them and goes deeper. Here's a code ...
3
votes
1answer
105 views

Simple HTTP server that performs a regex test

I'm sure that my server can work with better performance, but it's just a dream. Parsing a very long strings is not so obvious task for me. I have a server that handles a lot of clients requests and ...
3
votes
1answer
227 views

F# cache manager

This is a port of a C# cache manager we use to F#. This is my first F# code, and I've tried to make it as idiomatic as possible. I would appreciate input on style, performance considerations,...
3
votes
1answer
1k views

Serving a growing audio file with Django

I would like to serve a growing audio file (raw PCM audio for now) with the possibility of seeking. I tried to manage it with Apache, but in the end wasn't able to achieve what I wanted. Now I ...
3
votes
1answer
1k views

Send an email if a URL is down twice only

We want to check if a URL is down or not. But sometimes, the environment is down for maintenance for 3-4 hours and we don't want to keep sending emails during that time. I have written a shell script ...
3
votes
1answer
625 views

Storing folders of list of records in Google Drive

I've written a script using the Django ORM to store 'configuration settings' and interacting with the Google Drive API and another API. The script creates a base project folder and subfolders in ...
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). ...
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: ...
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
1answer
165 views

Set time zone from cookie

Is the set_cookie variable the correct way to signal that the cookie should be set? It does not seems pythonic to me: ...
3
votes
2answers
75 views

Static web server with a bit of error handling

I am looking for a review on this code, which is a simple static web server, with a small bit of error handling. It's feeling a bit "messy" / "imperative" at the moment, so advice would be welcome. <...
3
votes
1answer
89 views

Multi-threaded code to handle messages from a provider

Having a look at my code, is there a way to be losing elements? ...
3
votes
1answer
36 views

Initial attempt at node.js automatic redirection

I'm working on a Node.js HTTP server on my iPhone: ...
3
votes
1answer
277 views

Managing Httpcache from C# using JSON configuration

I have written an efficient way to control data to be cached/not-cached in HttpCache using JSON and C# controlling it. The reason for this implementation is to make use of existing application ...
3
votes
2answers
1k views

“Two way” HTTP Client

In one of my applications I make requests to a server. However, that server may at some point start making requests to my application as well. The server also allows polling, this means that I am able ...
3
votes
1answer
75 views

Getting the HTTP client's IP

Can you please tell me whether this is a good way to get the user's IP (IPv4 or IPv6)? Does someone have a better way to do this? Please take a look at the entire code, the ...
3
votes
1answer
3k views

Webserver for handling GET and HEAD requests

I have a programming assignment where I need to build a webserver which can handle GET and HEAD requests. My webserver is working as it should but since I'm still a newbie at Java I'm not sure about ...
3
votes
1answer
5k views

Getting HTTP Status Code

I have code that take in a URL (via URL or String) and returns the status code. I am new to web development, so it is very possible that I may be taking a poor approach at this. One thing I don't ...
3
votes
1answer
96 views

Using one service ($http) on all the controllers

I have recently started working on angular.js and I like it. I have decided to use a single controller per view. I use the json data from the backend. As my work is progressing, my codes are getting ...
3
votes
1answer
2k views

2 way communication Python socket

I'm trying to create a 2 way communication socket in python. The socket will listen for connections from the client until it gets the data formatted in string like this: 'PHONENUMBER|STATUS'. I will ...
3
votes
2answers
17k views

Efficient and fast way to send data from Android to server

I have an app that will be sending images ranging from few KB to ~20MB and I need to write a code that will do that in the fastest and most efficient way. I currently have a code that does this, but I ...
3
votes
1answer
100 views

HTTP routing framework

I am new to JavaScript programming and would like to get your comments/input or corrections on this chunk of code. I have tried to emulate patterns from recognized GitHub projects but I still don't ...
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 ...
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
1answer
69 views

Brightness Web Server

This is the first real program I've written in Go so have at it! I wrote it because I use a tiling window manager that doesn't have any brightness control functionality (at least not that I know of). ...
3
votes
0answers
1k views

Serving images from a Raspberry Pi camera over HTTP

I have a Pi with a camera module that I control with Python. I created a web server with web.py that allows me to make HTTP requests to the PI to retrieve an image. There are two optional parameters ...
3
votes
0answers
506 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 ...
3
votes
0answers
290 views

JSP evaluation of Parameters

I was never really sure what the cleanest way would be to use JSP-Pages for receiving sent parameters. It's common knowledge to use as little JSP as possible - yet as some things have to be done there,...
3
votes
0answers
437 views

Algorithm for downloading images

I am working on a product application where user could sell/buy. This application is based on collection view. Collection view has collection cell where it displays product image thumbnail. The ...
3
votes
0answers
77 views

Item purchasing using urllib

I have this function that gets an item passed from another function, together with the subtotal and the fee of the item. The function has to act as fast as possible, as other people also want the item....
2
votes
2answers
528 views

Two Python classes for a web crawler

I am using the Python module urllib3. It occurs to me that there is a better way to design a good class when I rebuild my last site crawler. ...
2
votes
1answer
53 views

Upload a file asynchronously

I need your opinion about my practice. I want to improve it. The requirements are the following: RESTFUL + OWIN (SelfHosted) Endpoint - Upload a file asynchronously Make a request to the endpoint ...
2
votes
2answers
757 views

Parsing JSON string from HTTP request

HTTP request is made, and a JSON string is returned, which needs to be parsed. Example response: ...
2
votes
1answer
13k views

NHibernate session and transaction implementation

In order to create loose coupling architecture on my web applications, I have created my own implementation for ORM, in this case, NHibernate. I want you please to review the code and tell me if you ...
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
3answers
171 views

HTTP redirects after login, registration, and logout

I am using following classes/interface to redirect user (after login, register, logout etc.) File: RedirectInterface.php ...
2
votes
1answer
102 views

Threaded and asyncio API library

In Python I am trying to create an API for a connected device. I want to be available for both threaded (using request) and async applications (using aiohttp). What I've come up with is wrapping the ...
2
votes
1answer
588 views

This brittle OData to SQL Server C# code isn't sustainable over time

The intent of this code is to access a third party OData API to capture only the relevant data to an existing in-house set of MSSQL server tables. Ignore the exception handling for now--the errors ...
2
votes
1answer
99 views

Downloading the oldest available version of some data files

I am using the cURL tool in MATLAB 2013b with Ubuntu to download a whole bunch of files. The files have one of three possible versions: 1.0.0, 2.0.0, or 2.1.0. Using the HTTP, I first check the ...
2
votes
1answer
3k views

RESTful HTTP Post with falcon

I wrote a small aggregator app that aggregates values from a json http post request and outputs the aggregated values. Now the aggregator function is somewhat large but the output appears correct. I ...