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

Telegram Bot that retrieves book information from GoodReads

The project below is about a Telegram bot that implements both inline and offline modes. The idea is to get a brief info about a book, searched by title(it's author, rating, short description). I ...
4
votes
1answer
201 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 ...
4
votes
1answer
108 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 ...
4
votes
1answer
820 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 ...
4
votes
1answer
53 views

Storing get call data on same function

I basically have a folder view structure, that each time I call grabs the value of the selected field and gets that specific folder data. I was wondering if there's a better way to do this by caching ...
4
votes
1answer
464 views

Ajax for RESTful web service

I wrote an Ajax function, which should be used in a framework to interact with a webserver. The (self-written) Java-Webserver can be used to fetch files and folder-contents, create files and folders, ...
4
votes
1answer
902 views

Web Crawler (A Tour of Go #71)

So I was trying to do this exercise from Tour of Go. I managed to get it working. I am not at all sure that it is correctly concurrent or idiomatic (I started learning Go, like, 4 hours ago). I would ...
4
votes
1answer
58 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 ...
4
votes
1answer
66 views

Python program that gets basic information on a Github user

I've created a basic Python CLI script, which takes a Github username, and returns some basic information associated with said username. I use the requests for HTTP requests (I'm new to this area) and ...
4
votes
1answer
739 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 ...
4
votes
1answer
963 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
599 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
58 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
272 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
78 views

Implement HTTP server using libevent

...
4
votes
1answer
64 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
718 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
1answer
1k 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
1k 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
675 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
190 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
864 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
2k 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
2answers
133 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
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
19k 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
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
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
3answers
177 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 ...
3
votes
2answers
117 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
2answers
59 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
82 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
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
377 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
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
3answers
565 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
1k 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: ...
3
votes
1answer
3k views

Check if the website is up

api.js ...
3
votes
1answer
207 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 2 3
4
5
8