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
88 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
178 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
1answer
522 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
616 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
380 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
131 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
212 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
95 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
55 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
93 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
147 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
539 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
263 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
369 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
64 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
1answer
362 views

Detect prefered language

I am using this script to detect the most prefered language by the user. ...
5
votes
1answer
188 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
0answers
9k views

Simple Router class

I made a simple routing class that I like to get reviews for, mostly because I do not know how to make it SOLID, since I even made this class separate from the HTTP response/request for the sake of ...
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
2k 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
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
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
9k 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
783 views

Simple Java web app code

I wanted to work on HttpSessions and JSP. This is the view I have: ...
4
votes
2answers
992 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
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 <...
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
363 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
233 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
190 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
26k 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
227 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
2answers
2k 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
611 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
172 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
789 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
462 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
878 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
57 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 ...