HyperText Transfer Protocol (HTTP) is an application level network protocol used for the transfer of content on the World Wide Web.
1
vote
0answers
34 views
Reading content of directory for each HTTP request
I have a piece of code written in node and I wanted to know if I am in the right direction. Basically I have a site where the homepage lists 6 vehicle cards. Every time the page is requested I do the ...
1
vote
1answer
57 views
Fetching and parsing HTML from a URL [closed]
I get a page with urllib2, then parse it with lxml. There are generally two things that can go wrong: a ...
1
vote
1answer
29 views
Simple POST function in ClojureScript and Node.js
Node's HTTP library provides a handy shorthand function for GET requests. Something similar doesn't exist for POST requests. I'm trying to write one in ClojureScript that compiles to node-readable ...
10
votes
1answer
292 views
C++ Http Request and Http Client abstractions
I am trying to make an OOP abstraction for a very simple http client. I have also created a simple abstraction for a (GET only for now) http Request.
I am using winsock2 sockets for Windows and the ...
5
votes
2answers
82 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.
...
3
votes
0answers
36 views
JSP evaluation of Parameters
I was never really sure what the cleanest way would be to use JSP-Pages for receiving sent parameters. It's common knowledge to use as little JSP as possible - yet as some things have to be done ...
5
votes
2answers
37 views
Single class which holds response and error message
I am working on a library which will make HTTP call to my rest service basis on inputs passed to this library. And whatever response comes back from service whether it is successful response or ...
-1
votes
1answer
40 views
Proper Use of Keep Alive For Loop
I'm working to make a thread that monitors a web API to get the latest announcement via JSON. I cannot test this currently, so I'm unsure if anything needs to be changed with this. I've read through ...
3
votes
2answers
134 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
1answer
54 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.
...
3
votes
1answer
127 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
vote
3answers
106 views
Retrying a web request in Python
Is it fine to retry a web service call like this in Python? Would there be any scenarios the exception might not work the way we expect it? I expect it to continue only if it's fine, otherwise just ...
4
votes
1answer
67 views
Implementing HTTP data range representation class
I need a class representing a parsed Range HTTP header value. I've done it like this:
...
1
vote
0answers
16 views
Proxying Socket.io requests and other HTTP requests
I have written a proxy server using node HTTP proxy, which can also be found on Github. I am bit unsure about whether I am proxying the web sockets correctly.
...
3
votes
0answers
82 views
Algorithm for downloading images
I am working on a product application where user could sell/buy. This application is based on collection view. Collection view has collection cell where it displays product image thumbnail.
The ...
3
votes
1answer
61 views
Serving a growing audio file with Django
I would like to serve a growing audio file (raw PCM audio for now) with the possibility of seeking. I tried to manage it with Apache, but in the end wasn't able to achieve what I wanted.
Now I ...
2
votes
1answer
30 views
Server that accepts HTML and PHP requests
For the Harvard cs50x MOOC I have completed an assignment in which a C server framework that functions like a barebones apache server is provided, to be finished by the student.
The below code will ...
3
votes
1answer
53 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 ...
0
votes
0answers
28 views
Downloading and reading data in go
I am trying to experiment with golang.
This code spins off two Go routines: one to download data and another to read from the body. Both go threads are synced by the data channel.
I have two ...
1
vote
1answer
31 views
Check that an image is available to be served
I have a couple of images in my database and I need to check if the images are still good or if they're deleted or corrupted. I came up with a solution but it's very slow. I was wondering if there was ...
1
vote
3answers
121 views
Using cookies in PHP
I was wondering if there was a better way to do this. Would that mean there would need to be no client-side refreshing to show the cookies when they are created?
...
7
votes
2answers
301 views
Non-blocking, non-threaded HTTP client implementation
This is a C# WinForms program targeting .Net 4.5. I am using it for a movie organizer application that will contact sites like OMDB, MyApiFilms, etc. for data about the movies. At the main application ...
3
votes
0answers
41 views
Item purchasing using urllib
I have this function that gets an item passed from another function, together with the subtotal and the fee of the item. The function has to act as fast as possible, as other people also want the ...
7
votes
1answer
79 views
First SO chat message in Haskell followup
I have wrote an application which asks for the user id, and returns a link to the first available chat message:
Output
Enter user id:
322395
Fetching data...
...
2
votes
0answers
606 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
0answers
53 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 ...
6
votes
1answer
234 views
Manually parsing HTTP response header
Due to some constraints I had to manually parse an HTTP response coming out of a stream.
I could not use buffered reader or scanner because the perform buffering and end up buffering bytes beyond the ...
16
votes
3answers
1k views
Simple webserver in C
My first learning project in C. Looking for general feedback e.g. gotchas, coding standards, formatting, naming etc. I'm here to learn!
webserver.h
...
1
vote
1answer
89 views
Resumable HTTP download class - Follow-up
Is there a better way to calculate the download speed than what I'm currently doing now? Are there any suggestions on improving the updated code?
Pure version:
...
6
votes
4answers
406 views
Resumable HTTP download class
Any suggestions, corrections and advice would be very nice and much appreciated.
...
5
votes
2answers
100 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 ...
2
votes
1answer
191 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 ...
0
votes
0answers
79 views
Parallel chunk uploading through HTTP requests
I am writing this class for parallel chunk level uploads to my local server. This reads the files in a given directory, uploads with n threads in parallel.
Initially, sends a request and obtains a ...
2
votes
2answers
113 views
Parsing JSON string from HTTP request
HTTP request is made, and a JSON string is returned, which needs to be parsed.
Example response:
...
4
votes
1answer
51 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
63 views
Getting the HTTP client's IP
Can you please tell me whether this is a good way to get the user's IP (IPv4 or IPv6)? Does someone have a better way to do this? Please take a look at the entire code, the ...
2
votes
1answer
118 views
File upload to web server using HttpRequestFutureTask
I am working on uploading files through Rest API. Tried my hand using single upload and works. I have modified to accommodate parallel uploads using Futures.
Will there be any chance that this code ...
5
votes
2answers
868 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
...
4
votes
2answers
283 views
Asynchronous HTTP JSON request
For asynchronous requests, I use Alamofire.
I have created one method for requesting async data.
...
1
vote
2answers
454 views
Utility class for an HttpURLConnection
I am creating a utility class to do an HttpURLConnection. I want to make this class generic as in I pass the URL and the POST params. It works with any range of ...
3
votes
2answers
434 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 ...
0
votes
0answers
131 views
HTTP handlers exercise (tour of go)
The challenge, from Tour of Go, "Exercise: HTTP Handlers":
Implement the following types and define ServeHTTP methods on them. Register them to handle specific paths in your web server.
...
4
votes
2answers
473 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
430 views
Receiving a JSON string response from a URL
I am using RestTemplate as my HttpClient to execute a URL while the server will return a JSON string as the response. The ...
6
votes
1answer
273 views
Calling other machines from the LinkedList if one is blocked or down
This is a follow on to : Simplifying asynchronous "executeAsync" method along with "onFailure" callback.
I am using AsyncRestTemplate as my ...
7
votes
3answers
508 views
Simplifying asynchronous “executeAsync” method along with “onFailure” callback
I have a system in which user id is "sharded" across all the machines which means each machine is responsible for certain user id data. I am working on a library which will take ...
4
votes
1answer
1k 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, ...
2
votes
1answer
50 views
Logging of various exceptions in the callback
I am working on a library in which I need to execute my URL using AsyncRestTemplate and after that I will get a json response back if it is successful. I am also making ...
3
votes
1answer
176 views
Webserver for handling GET and HEAD requests
I have a programming assignment where I need to build a webserver which can handle GET and HEAD requests. My webserver is working as it should but since I'm still a newbie at Java I'm not sure about ...
5
votes
2answers
174 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 ...