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
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). ...
4
votes
1answer
191 views

Cookie, Session, and Flash middleware for Iron framework

Iron's cookie and session middleware projects seem to be abandoned. I've put together implementations for them, along with a ...
3
votes
1answer
2k views

Check if the website is up

api.js ...
2
votes
1answer
170 views

Android network API request

I often use a similar scheme work with an API project. Can it be made easier, or is there a standard approach? This class creates an API request: ...
4
votes
1answer
177 views

xkcd comics data provider

Please help me improving this code(golang), thanks! Why I need built a API for xkcd Can't get the data provided by xkcd directly in front-end(CORS). So we can package the data to 10 comics per ...
2
votes
0answers
268 views

Low performance of HTTP request using Haskell wreq

The program makes HTTP requests (checks video stream status) and calls an external program. ...
6
votes
1answer
80 views

Script to download sequentially named files, rename them, and delete smaller files

I've written a little script to download sequentially named files, rename them, and delete files smaller than an certain number of kilobytes. I came up with this but I'm not too happy. Any advice for ...
4
votes
1answer
1k views

NSURLSession load images on demand

I'm trying to come up with a system to populate my item images on demand, this is what I have so far. One obvious bug is that an item image could be downloaded multiple time since the ...
0
votes
2answers
226 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: ...
5
votes
2answers
149 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: ...
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 ...
6
votes
4answers
77 views

Two HTTP notification methods

I have two very similar methods, which make HTTP requests, the difference is that one makes PUT and another GET. Is there any proper Ruby way not to repeat the setup code and not to pass the flag ...
11
votes
2answers
7k views

Efficiently using Apache HttpClient in multithreaded environment

I have a library which is being used by customers and they are passing DataRequest object which has userid, various ...
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 ...
4
votes
2answers
591 views

Getting JSON data from an HTTP response using conditional binding

I am new to Swift and I am trying to use the optional binding feature in as efficient way as possible but I am a bit confused on how to use it (if I can) in this scenario: ...
3
votes
1answer
357 views

AsyncTask method

Even I know that this isn't a good way of writing code, but I need to improve this. Here I am retrieving data from Server in Json format by Posting some variables in doInbackground. Getting all the ...
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 ...
2
votes
0answers
252 views

Fetching a weather report on an Arduino from a web service

I'm writing some code which is basically supposed to http get some information from my own website and parse it, which (finally) works. However, when I compile the code, it shows this: Sketch uses ...
2
votes
0answers
55 views

Node.JS HTTP shortcut wrapper

The Node.JS HTTP and HTTPS modules only provide .get shortcut function, unlike AngularJS's $http which provides them all. I went ...
3
votes
1answer
286 views

NodeJS static file HTTP server

I wrote a NodeJS HTTP server specifically for serving static files. I didn't bother much about security since the server is going to be used locally in my Electron application. ...
1
vote
0answers
125 views

Posting HTTP session data on a website

This reads lines from a file, create HTTP sessions and post data on a website. The code is slow, so please suggest how I can improve the performance. ...
10
votes
1answer
4k views

Node.js parallel file download, the ES6 way

I wrote a script that downloads all PDFs found on the web page of a particular government agency. I would have chosen bash for such a task, but I want the script to ...
1
vote
2answers
1k views

Asynchronous lookup over HTTP and checking the status

For some reason declaring ApiResult before checking if the answer is in a correct status doesn't look good. I wonder if there is any better way to check the status ...
4
votes
1answer
798 views

Determining the HTTP status code to return for a request

I have a piece of code that I would like to refactor but can't figure how to do it. This is a method from a Play controller where I have to verify many precondition and respond different status for ...
8
votes
1answer
5k views

Simple Multi-Threaded Web Server

Need a way to test a web crawler. Threw together this web server that will replay previously saved pages from a real web server. Headers ...
5
votes
1answer
563 views

Multilanguage class that detects and sets language

I have been learning object oriented programming for quite a while. I understand many concepts about it but I quickly realized that I made a big mistake just reading theory and not doing any actual ...
5
votes
3answers
389 views

Python HTTP Server

This is one of my first times writing Python. I'm most curious about style and whether while 1: x,y = socket.accept() is an acceptable way to wait for new ...
4
votes
2answers
2k views

Limit HTTP request rate for spray/akka-http

I want to limit the request rate in a spray/akka-http route. I'm not an expert with both scala and spray/akka but learning. So I came up with the following custom directive: ...
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,...
1
vote
0answers
74 views

Reading content of directory for each HTTP request

I have a piece of code written in node and I wanted to know if I am in the right direction. Basically I have a site where the homepage lists 6 vehicle cards. Every time the page is requested I do the ...
1
vote
1answer
351 views

Simple POST function in ClojureScript and Node.js

Node's HTTP library provides a handy shorthand function for GET requests. Something similar doesn't exist for POST requests. I'm trying to write one in ClojureScript that compiles to node-readable ...
13
votes
1answer
11k views

HTTP request and HTTP client abstractions

I am trying to make an OOP abstraction for a very simple HTTP client. I have also created a simple abstraction for a (GET only for now) HTTP request. I am using ...
5
votes
2answers
179 views

Bash script to download sequentially numbered images

This is a pretty basic bash script (3.2 on Mac). I am downloading 584 images from a site in order to create an album. ...
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,...
6
votes
2answers
4k views

Single class which holds response and error message

I am working on a library which will make HTTP call to my rest service basis on inputs passed to this library. And whatever response comes back from service whether it is successful response or ...
0
votes
1answer
85 views

Thread that monitors a web API to get the latest announcement via JSON

I'm working to make a thread that monitors a web API to get the latest announcement via JSON. I cannot test this currently, so I'm unsure if anything needs to be changed with this. I've read through ...
4
votes
2answers
1k views

Searching the Foursquare API with Python

I'd like some feedback on the readability, style, and potential problems or issues. foursquare.py ...
4
votes
1answer
596 views

Return different type of response based on Accept header

I'm a novice to Scala and Akka-Http and am experimenting with Akka-Http for writing rest services. I have to return JSON or protobuf based on the Accept-Header. ...
3
votes
1answer
206 views

Handling HTTP requests and saving user to database

I am using Play Framework and Slick. In userController.scala I am handling HTTP post requests and sending to personRepository.scala. Is this controller and method written in the correct way? ...
1
vote
3answers
6k views

Retrying a web request in Python

Is it fine to retry a web service call like this in Python? Would there be any scenarios the exception might not work the way we expect it? I expect it to continue only if it's fine, otherwise just ...
4
votes
1answer
98 views

Implementing HTTP data range representation class

I need a class representing a parsed Range HTTP header value. I've done it like this: ...
1
vote
0answers
800 views

Proxying Socket.io requests and other HTTP requests

I have written a proxy server using node HTTP proxy, which can also be found on Github. I am bit unsure about whether I am proxying the web sockets correctly. ...
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
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 ...
2
votes
1answer
44 views

Server that accepts HTML and PHP requests

For the Harvard cs50x MOOC I have completed an assignment in which a C server framework that functions like a barebones apache server is provided, to be finished by the student. The below code will ...
3
votes
1answer
79 views

HTTP client for company services

For quite a while now I've been writing a bit of Ruby code, but so far I still don't think it was good idiomatic Ruby. But there's been a new requirement and I tried my best writing it better, more ...
1
vote
1answer
81 views

Downloading and reading data in go

I am trying to experiment with golang. This code spins off two Go routines: one to download data and another to read from the body. Both go threads are synced by the data channel. I have two ...
1
vote
1answer
32 views

Check that an image is available to be served

I have a couple of images in my database and I need to check if the images are still good or if they're deleted or corrupted. I came up with a solution but it's very slow. I was wondering if there was ...
1
vote
3answers
1k views

Using cookies in PHP

I was wondering if there was a better way to do this. Would that mean there would need to be no client-side refreshing to show the cookies when they are created? ...
9
votes
2answers
2k views

Non-blocking, non-threaded HTTP client implementation

This is a C# WinForms program targeting .Net 4.5. I am using it for a movie organizer application that will contact sites like OMDB, MyApiFilms, etc. for data about the movies. At the main application ...