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

Python API client

I'm creating a Python API client, after thinking and checking some open source Python clients I created this class, and I'm looking for any feedback (design, best practices...), this is an example URL ...
5
votes
2answers
200 views

Downloading list of images

This code downloads a list of images, each in a different thread. I have some questions about this code: I don't know how to get information about correcting downloading (sometimes thread just ...
5
votes
1answer
18k views

Unit testing HTTP requests

I would like to unit test my web requests, so on top of my head I came up with the solution below. Since it seems to be working fine, I'm posting it on this site. Though it doesn't feel very dynamic, ...
5
votes
2answers
247 views

Minimal webserver in C++, second revision

First revision: Minimal webserver in C++ Here's my test question for C++ programmer job: Servers only static content, no cgi Single process, multithreaded 1000 concurrent request at least Valid http ...
5
votes
1answer
94 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 ...
5
votes
2answers
3k views

Parsing a HTTP request

I'm currently writing a pure ruby webserver, and one of the things that I have to do is parse a HTTP request. The method I've pasted below takes a HTTP request, and puts it in a map keyed by the ...
5
votes
2answers
185 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. ...
5
votes
2answers
2k views

“Remember me” functionality for a website

I have read a few SO threads to implement remember_me functionality. Steps I have followed: User clicks on login button and if passes client side validation, it goes to php Login page. First time <...
5
votes
1answer
531 views

Configuring Constructor Parameters and Unit Testing

Currently working on writing out some test for an iOS enterprise application. My concern is in this set up of my overloaded constructor. ...
5
votes
2answers
1k 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 ...
5
votes
1answer
5k views

Session handling using Python Requests client

I'm using this code to login to an experiment login system created by me for this purpose. ...
5
votes
3answers
398 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 ...
5
votes
2answers
6k views

External API calls from a C#.NET client

I have a simple c# mvc client that calls an external api..here is my attempt ...
5
votes
2answers
132 views

Java HTTP Apache - Making my own library

My company has asked me to write a few Java based programs to deal with sending HTTP requests and parsing the response. After playing around with the Apache HTTP Commons library and making plenty of ...
5
votes
1answer
307 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 ...
5
votes
1answer
97 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 ...
5
votes
1answer
57 views

Basic request script

I've just recently started running some wargames (Natas, OverTheWire) and thought I'd implement some of my scripting experience to solve them instead of doing it manually (though I did that first). I'...
5
votes
3answers
94 views

Repeatedly fetching a URL until the response contains “state: INIT”

I am working on a project in which I need to make a URL call to one of my servers from a bash shell script. http://hostname.domain.com:8080/beat After hitting ...
5
votes
1answer
8k views

Swift project using PHP web service

I was hoping for someone to review my current project, which was created in Swift and uses a PHP web service. I'm not worried about UI elements, as this is just a 'test' project, but I'm concerned ...
5
votes
1answer
5k views

Making multiple http request Angular2

I need to get some ids from contacts and contactgroups to be able to collect the data. My example works but i dont know if this is the way to go. ...
5
votes
2answers
154 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: ...
5
votes
1answer
638 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
268 views

Concise HTTP server

Here's my code for a consise node.js HTTP server. It does work as intended, but I'd like to ask if there's any glitch or to be improved. ...
5
votes
1answer
388 views

Python wrapper for official Hacker News API

Since Hacker News launched their official API, I started working on Python wrapper for it. API v0 is fairly simple, you send a GET request with hacker news story's ID or user id, it returns data in ...
5
votes
1answer
68 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
385 views

reusing Body in http.Requests (goproxy)

Goproxy is a Go package implementing an HTTP proxy. I am using it to store requests from a client (eg: a web browser) for further processing. In an ...
5
votes
1answer
376 views

Detect prefered language

I am using this script to detect the most prefered language by the user. ...
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
3answers
2k views

Generic WebRequest Method for .PCL

I have created this method to do all my WebRequests. Generally my question is, if this could be improved in any way. As a side question, I would like to know if it be better to create methods for ...
4
votes
2answers
3k views

Language-detection PHP script

I'm working on a webpage with language detection and I have the following script so far (it's simple). I still haven't done the user detection, so it's not available to find the user language (yet), ...
4
votes
2answers
3k views

Handling HTTP requests

This class handles HTTP requests. It's a singleton class that parses URI to get the controller, method and parameters and then executes the controller's method. Maybe ...
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 ...
4
votes
1answer
91 views

Making this site navigation less verbose

I have this one controller that serves up all the webpages and any dynamic content. Is this the most efficient way of doing this? Can it be improved? ...
4
votes
2answers
10k views

Generic HTTP using Android Asynctask

I have developed a generic HTTP functionality using Android Asynctask and Apache HTTP client. Please review the code and let me know if it is the right way of doing or there are other ways to achieve ...
4
votes
2answers
2k views

Client-server application

This is my very simple client-server application. Client sends some commands to the server and server gives back the output to the client. However, my special concern is about the GET command sent to ...
4
votes
2answers
787 views

Simple Java web app code

I wanted to work on HttpSessions and JSP. This is the view I have: ...
4
votes
2answers
1k views

Scanning through logs (tail -f fashion) parsing and sending to a remote server

I have a task at hand to build a utility which Scans through a log file. Rolls over if a log file is reset. Scans through each line of the log file. Each line is sent to an executor service and ...
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: ...
4
votes
3answers
4k 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 ...
4
votes
1answer
4k views

HTTP Get & Post code with slow performance

I had developed an application in which I hit several URLs and show data on mobile. But the problem is that it requires more time. If I check the same URL on Firebug tool I get a response in 2-3 ...
4
votes
4answers
365 views

What is the shortest snippet that emulates `include` in JavaScript without third-party scripts?

JavaScript doesn't offer a module system. There are many third-party solutions, like require.js or jQuery's $.getScript. Most, ...
4
votes
2answers
396 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 ...
4
votes
1answer
3k 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 ...
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 ...
4
votes
1answer
28k views

Using RestTemplate for HTTP request timeout

I am using RestTemplate to make an HTTP call to one of my service and I would like to have timeout for my HTTP Request: ...
4
votes
1answer
4k views

Wrapping Curl, an HTTP client

I have written an HTTP client wrapped the libcurl. It should be able to do HTTP get/post with string/map param, with cookies and proxy. Can somebody review the code? B.T.W., I'm not sure the way ...
4
votes
2answers
233 views

Proxy evasion browser in Python

This code works. It is designed to retrieve website data directly, parse it, and open it as normal. I will develop it further later. Right now I want to know if there is any way to improve efficiency, ...
4
votes
1answer
112 views

Download NASA images to use as Windows wallpaper

I made myself a simple script (Batch/JScript) that download a pic from a blog (APOD) & set it as wallpaper. ...
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
663 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 ...

1 2
3
4 5
8