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
4
votes
1answer
749 views

Simple file server for GET requests

I recently made this simple server in C for Linux systems and was wanting to get another set of eyes on it for a review of the design. I am new to socket programming and used a textbook from school to ...
4
votes
1answer
592 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. ...
4
votes
1answer
57 views

Saving away URL query parameters in an analytics application

We are trying to use NodeJS for analytics. The following code gets the parameter from a URL and dumps it into a flat file. Is there any way to optimize it to get better response time? ...
4
votes
1answer
265 views

Socket.IO handshake module

For the server of which this is part, it makes a request to one of our web servers to validate whether the PHP Session ID is actually valid. The location ...
4
votes
1answer
102 views

Server code to save uploaded files

This code basically saves an uploaded file to the server. I am wondering if there is anything that I can do to tighten this code up. I am very new to F# so I'm still having trouble breaking away ...
4
votes
1answer
499 views

Craigslist search-across-regions script

I'm a JavaScript developer. I'm pretty sure that will be immediately apparent in the below code if for no other reason than the level/depth of chaining that I'm comfortable with. However, I'm learning ...
4
votes
1answer
53 views

Basic network layer for a JSON API client

Just looking for some feedback/ways to improve this basic networking layer written in Swift. I'm still learning, please elaborate with as much detail as possible. ...
4
votes
1answer
755 views

Generating absolute URIs behind a reverse proxy

In my ASP.NET MVC application there are occasions where I need to generate an absolute URI, such as when sending an email confirmation link to a user. The most straightforward approach is to use ...
4
votes
1answer
706 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 ...
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 ...
4
votes
2answers
571 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: ...
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: ...
4
votes
1answer
76 views

Find first SO chat message in Haskell

I have made some simple functions to find the first SO chat message. How can I improve my code? Even if there is a stackoverflow link that will get the job done (I'd be glad to know), I'd like to ...
4
votes
2answers
3k views

HttpRequest.Json collection - like HttpRequest.Form

I'm looking for a code correctness and best practices review on the following. I created the following in order to prevent using the same code to convert serialized JSON to something more accessible ...
4
votes
1answer
7k views

Subclassing AFNetworking to handle POST / GET requests

I am pretty new to iOS development - I'm writing an app the uses web services, pretty extensively. With that in mind, I decided to use AFNetworking 2.0 and subclass ...
4
votes
0answers
173 views

Simple routing in Rust

After my last attempt, I started to learn Rust again. This time I wrote a simple HTTP router. I would appreciate it if you could help me to fix my mistakes. Here is the link of the repository main....
4
votes
0answers
53 views

Basic Python HTTP Server

It's an extremely simply HTTP server in Python using the socket library, and a few others to get the MIME type, etc... I've also avoided the ../../ vulnerability, ...
4
votes
1answer
323 views

Node.js http retry do while mechanism

I have implemented a simple do/while loop to handle a http request to a third-party. I don’t know when the data I receive will have elements in its array so I retry up to 10 times until the array ...
4
votes
0answers
763 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 ...
4
votes
0answers
1k 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# ...
3
votes
3answers
1k views

HTTP Performance Test in C#

I wrote a script to test how long it takes to make requests against a url. It takes a list of urls, an array of concurrent requests, and a number of times to attempt the test. How could I improve on ...
3
votes
1answer
1k views

Why is my web scraping script so slow?

My script, which is a web scraping script, is very slow, I even needed to put set_time_limit(0); This is the whole http://phpfiddle.org/main/code/9qt-78n I think the problem is here: ...
3
votes
2answers
18k views

Brute force HTTP with Python

I am playing around with brute force attack on my home network. I wrote the following script with Python. However progress is a little slow. Does anyone have a suggestion how to make this faster? <...
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
2answers
110 views

Filter request code handler

I use the following code which works OK, the code is filtering requests and in case there are too many requests it sends some logs/errors since I'm very new to Java my question if there is a better ...
3
votes
2answers
1k views

Mutual friends finder written in Python

I've written a server/client tool which can "check the Six degrees of separation theory" in Russian social network VK.com. Client sends task (which contains two VK IDs) and Server tries to find all ...
3
votes
1answer
112 views

JSON fetcher for Eclipse plugin

This is a client module of an Eclipse plugin. I am planning to use this code as a "good exception handling" code example in one of my papers. How does it look? ...
3
votes
2answers
57 views

Generic function that accepts both Actions and Func's as parameters

I've created a generic try catch I can apply throughout my code so I'm not repeating myself. ...
3
votes
2answers
78 views

Download and save bulk URL concurrently

I am new to Go and wrote program to download and save bulk URLs concurrently. It is working correctly, but I would like to make it more efficient and follow best practices. ...
3
votes
2answers
770 views

Very basic C++ HTTP Parser

I was bored, so I decided to write a very basic HTTP Request/Response parser in C++. Some Notes: This isn't meant to be a complete implementation of the HTTP protocol This isn't meant to be the ...
3
votes
1answer
4k views

Downloading data using HttpClient

I'm working on a class to download some data from an external server and feed it into my data model. I'm new to both HttpClient and ...
3
votes
2answers
360 views

Is this program susceptible to a buffer overflow exploit?

I use it in a number of embedded devices. It loads the query parameters from an HTTP GET/POST request and prints them to stdout in FORM_key=value format which then ...
3
votes
3answers
3k views

Seekable HTTP Range Stream

I read around for a while and surprisingly didn't find a fitting solution. I need a .NET Stream that internally issues HTTP Range requests when it seeks. There are huge files server-side for which I ...
3
votes
2answers
3k views

Load images, manipulate DOM, store/retrieve data using localStorage

I wrote a little code sample which: load images manipulate DOM (replace images) store/retrieve related data using localStorage ...
3
votes
1answer
145 views

Simple httpcode monitor

I'm making a simple httpcode monitor as an example for teaching myself PHP OOP. I have written the code below and would be interested in having it improved. In particular, I'm not sure about this ...
3
votes
2answers
2k views

Try every username and password from a list on a website

This code will be brute force specific site using http POST method. ...
3
votes
3answers
247 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 ...
3
votes
1answer
2k views

Check if the website is up

api.js ...
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? ...
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 ...
3
votes
2answers
4k views

Correct way to implement a Singleton field

I have a helper class that does HTTP operations on Android. Every method uses a client field. I think it's a good idea to make this client a singleton since every method in the class uses it. The ...
3
votes
1answer
271 views

Crawling for emails on websites given by Google API

I'm trying to build an app which crawls a website to find the emails that it has and prints them. I also want to allow the user to type "false" into the console when they want to skip the website (...
3
votes
1answer
149 views

Golang HTTP requests

I'm beginning to learn about Golang and I would like to have some advice about the following program. ...
3
votes
1answer
421 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 ...
3
votes
1answer
78 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
983 views

Resumable download with System.net.HTTPClient

This is a Delphi class, based on System.net.HTTPClient with a function for downloading a file from a URL and saving on a filename destination: ...
3
votes
1answer
352 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
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. ...
3
votes
1answer
11k views

HTTP Request/Response class

I would like to get feedback on this, which are just simple Response/Request classes. I tried to keep it simple, so I made two ...
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 ...