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
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 ...
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 ...
10
votes
1answer
7k views

Faster Django CSV generation for several million database entries

I am writing a CSV file generator that's filtering through about seven million database entries (MySQL backend). This part is especially slow and I was wondering if there is a way to make it much ...
14
votes
2answers
14k views

HTTP server and multi-threading optimization

I wrote an HTTP server for the management of scores for users and levels. It can return the highest score per level. It has a simple login with session-key. What do you think could be improved in ...
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 ...
3
votes
1answer
627 views

Storing folders of list of records in Google Drive

I've written a script using the Django ORM to store 'configuration settings' and interacting with the Google Drive API and another API. The script creates a base project folder and subfolders in ...
2
votes
1answer
13k views

NHibernate session and transaction implementation

In order to create loose coupling architecture on my web applications, I have created my own implementation for ORM, in this case, NHibernate. I want you please to review the code and tell me if you ...
3
votes
1answer
18k views

HTTP URL validating

What do you think about this? ...
4
votes
4answers
367 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, ...
5
votes
2answers
7k views

Is it ok to use HttpContext inside View?

I have a pretty common issue: I need to know the name of current user and also name of the current controller so I can highlight/disable some links. Here's some solutions I found by myself: Get all ...
2
votes
2answers
535 views

Two Python classes for a web crawler

I am using the Python module urllib3. It occurs to me that there is a better way to design a good class when I rebuild my last site crawler. ...
2
votes
2answers
175 views

Calendar events based on user feedback

Here's a bit of one of my web forms which is reached by clicking on a link in a calendar. Based on what you click, you end up at this page with a different ...
15
votes
4answers
2k views

How to shorten this terrible HTTP header parser?

I am trying to read a line ending in \r\n from a Handle. This is an HTTP header. I’m fairly new to functional programming, so I ...
11
votes
3answers
547 views

Exception handling, et al - How do I make this web downloader not “poor”?

I haven't done Java coding in years, but I thought I would give it a shot for a job interview. I have a few questions: Why is this error handling considered poor? How am I supposed to be doing it? ...
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
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? <...
7
votes
2answers
4k views

Custom Authentication Attribute

I was trying to find a way to redirect to different pages on authorization and authentication failure. I found this to be a possible solution. However, I ended with a different solution by myself. It ...
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. ...
2
votes
1answer
1k views

Parsing a page's source code for URLs

My code has to download the source code of a page and parse it for URLs. I want it to ask for number which is increased inside the critical section. My problem happens on thread termination. Main ...
7
votes
1answer
264 views

What is better for the code segment, sockets or multiple processes?

I am trying to fetch information out of SHOUTcast for mutiple users at the same time. Here is my current code: ...
1
vote
0answers
171 views

Optimizing URL router behaviour

I'm trying to create an URL-router, where the website language is defined by the first two chars in the domain. Example: domain.com/en (the site will then display content in English). The script ...
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), ...
16
votes
1answer
1k views

Simple xkcd comic downloader

I'd really appreciate some harsh/constructive criticism of what I would consider as my first program in Haskell. The program should download all of the xkcd comics into a folder in the current ...
6
votes
1answer
4k views

Interfacing with RESTful web services

The following working function seems a bit hacky to me as it has been pieced together from a handful of (probably poorly written) online tutorials, and I want to know if there is a better (or more ...
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 ...
13
votes
3answers
1k views

Was this shell script ready for open-source? (Random XKCD wallpaper)

I wrote the following little shell script and published it on GitHub. In the repo there's also a README file that explains how to use it in more detail. This is the first time I open-sourced/...

1
4 5 6 7
8