Questions tagged [http-request]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
37 views

How do I create an HTTP PUT request that modifies the resource in many ways

I have a NodeJs backend that interacts with MySQL database. Let us assume that I have a schema similar to this: Book id name Author id book_id name So, I have two tables named Book and ...
1
vote
1answer
35 views

Client-side XHR request, which IP does the endpoint read?

Assume a Javascript plugin, for a developer, that's included on their website. <script src="https://external.com/plugin.js"></script> The plugin makes a XHR request to a 3rd party ...
-2
votes
2answers
69 views

REST API acceptable design flexibility

I design and works on lot of projects involves REST APIs. But one question is always occur to me if it is acceptable way to do REST. So according to REST manuals online, REST is build upon two major ...
0
votes
0answers
70 views

HTTP Method and REST URL for Returning Data that May Be Saved

My application has a grid with a list of Car objects from a third party system [{id: 1, make: "Ford", model: "Focus", ...},...] The user can select a Car and use its data (after some transformation)...
1
vote
2answers
144 views

Is it okay to use a 'HttpPut' or 'HttpPatch' verb and allow the API method not to check for a Patch doc or resource?

I'm not sure what the correct procedure is, when you have a question based off an answer you read but it is a seperate question that arose because of the answer provided. the answer in question Which ...
0
votes
1answer
112 views

Which is better solution - having separate model class against each REST API or keep adding info in single object?

I have a class Person. Person { String firstName; String lastName; String Date dob; String email; String mobileNumber; String address; } To add a person, I have following REST APIs: POST /...
1
vote
0answers
161 views

How to simplify design and remove duplication in java layered architecture?

I've the following project structure (simplified): domain dto view In domain model is kept. dto classes are used to pass data from domain to view. And in view I've a controller and a handful of *req,...
7
votes
3answers
457 views

What reasons are there AGAINST using only POST HTTP verb in an API?

I am researching before starting to work on an API for a web-service I am building. The goal is to be very quick and easy to adapt and use for other developers but fairly hidden for clients using a ...
1
vote
1answer
150 views

Theoretical: How Do Servers Handle Requests With No Spare Memory?

I'm trying to understand how servers handle many requests when they start to run out of RAM. Let's say you have a server with 1GB of idle RAM. Let's pretend it was bombarded with 1024 requests in 1 ...
2
votes
2answers
3k views

Better to block on async with HttpClient than use synchronous API like WebRequest?

I have been a staunch advocate of never blocking on async code. I felt it was always better to use a synchronous API than to run the less efficient state machine generated by the compiler even if ...
0
votes
2answers
138 views

How to limit the amount of requests by minute to a external system on a micro services environment?

I'm having some problems to think on a solution to control the amount of requests by minute to a external system on a micro services environment on Kubernetes. The scenario This external system is ...
4
votes
1answer
8k views

Use Case of HTTP GET Request with a Body

I am maintaining a old .aspx page in which all the data required by the page to show the content is passed in the URL of the GET request as a part of query string. The result of this is that, as we ...
0
votes
3answers
178 views

How far do you go in server-side validation of POST/GET requests?

Our application had a few vulnerabilities detected by AppScan and we had to add server-side validation to catch SQL injection attempts. But my question is, how far do you go in server-side ...
-4
votes
1answer
873 views

What happens if multiple users send http requests to the server concurrently? [closed]

So basically, it is a web server that is hosting a php project. The project accepts some inputs from the users and send them to the server via ajax for validation each time the check button is clicked....
2
votes
1answer
155 views

How to HTTP request to a website that uses robot verification

I need to make some get/post requests to a website that I have credential to log in. I plan to do this with Ruby and Net::Http. As I'm new to this kind of experience, I'm struggling with the fact that ...
8
votes
2answers
3k views

What is a proper response status code to POST when parent resource is not found?

I've the following endpoint: a/{id}/b and want to create a b with sending POST request to it. If a with given {id} is not found should I response with 404 NOT_FOUND or maybe with 409 CONFLICT? It ...
0
votes
2answers
2k views

how to define a HTTP PATCH to edit multiple entities in one request

I am looking for some advice in regards of best practices to build a HTTP PATCH request that can edit multiple entities in one request. The reason I am asking is because to me Rest API is quite vague ...
0
votes
1answer
205 views

is the term “payload” is used exclusively in request?

Is the term "payload" used exclusively for the payload of (let's say http) request or it may be used to describe the useful information in the response of a request? If its used for both payloads (...
-4
votes
4answers
788 views

Is get and post interchangeable?

I know that there are some differences between GET and POST, like descriped in this post on StackOverflow. But what I cannot figure out is, are they interchangable, assuming that you change your code ...
6
votes
2answers
422 views

What is the right way to make HTTP requests when a slider's value changes?

I am designing basic software for smart wireless lighting systems. The software is GUI based, and I have a slider for the brightness setting of a light in my GUI. The lighting system has a RESTful API ...
0
votes
1answer
2k views

How to make sure JSON payload limit does not exceed a certain value during a web request?

I need to call third party APIs where the payload size has a maximum size limit, say, 4 MB. That means I cannot call the API with a payload more than 4MB in size. How can I solve this in an ...
0
votes
1answer
976 views

making http request by ajax or c#

In my web application I need to get data from Wikidata, for example to show item's details. I thought about using ajax for this, but was't sure from where I should to call it, so I asked this question....
6
votes
2answers
135 views

Is repeating an identifier on an API request and response considered a code smell

Is it weird to have an identifier such as (_id) on a request which you send to the API, which "enriches" the request and sends back a response with the same identifier (but obviously more enriched ...
0
votes
4answers
730 views

What makes (or why is) a language Server-Side?

Since Swift 3 is boasting its new capabilities, it occurs to me that I don't actually know why Swift is server-side. I've been hunting "Full Stack" and the listings have MEAN, they have C#/ASP, some ...
4
votes
2answers
2k views

REST Webservices (post / put) : which type of parameter should I choose, and when?

On a POST (or PUT) webservice, I know can use three different type of parameters, I can send my parameters in the path of the URL /objects/{path_param}, after a question mark in the URL /objects?{...
1
vote
3answers
1k views

Is there an industry-standard equivalent to cURL?

A bit of background information: I'd been a Java developer for a company for about 6 years. This company used a variety of Linux-based operating systems for its day-to-day operations; all of our ...
50
votes
6answers
72k views

Should we create a new single instance of HttpClient for all requests?

recently I came across this blog post from asp.net monsters which talks about issues with using HttpClientin following way: using(var client = new HttpClient()) { } As per the blog post, if we ...
0
votes
1answer
85 views

Need my mobile application to connect my website, will this method be better than using an API?

I want my mobile app to connect to my website to get/post data from and to the database, respectively. I was looking up RESTful APIs (which I don't really understand how the file writing and ...
3
votes
3answers
143 views

Is consolidating/reducing HTTP requests worth the logistical complexity?

Some examples: CSS image sprites Compiling JS needed on every webpage to one file Implementing lazy-loading for images Consolidating all meta information (username, CDN address, etc) into one request ...
-3
votes
1answer
47 views

Passing dynamic data to declarative resource load tags in an HTML document?

Is it possible to pass dynamic data to the browser when it automatically GETs link and img and script etc tags after it has parsed the html containing them? Ultimately would want to pass an ...
1
vote
0answers
624 views

Best practices for encoding information in URL

I have implemented a tracking pixel that is simply an img tag that another party puts on their website. This works by making the src refer to our endpoint with query params set with extra information. ...
2
votes
1answer
741 views

Is there a cross-platform way to open a TCP connection, send a HTTP post request and keep the connection open?

I'm searching for a way to open a TCP connection, send a HTTP post request and keep the connection open. It would be great if I can achieve this without administrator/root rights, from a command-line ...
-2
votes
2answers
144 views

Is using AJAX worth it in the inner administrative system? [closed]

Imagine we have a administrative system that is designed to be as fast and lean as possible, without too much fancy CSS or JS. The UE is not that great, but still it is pleasing on the eyes and gets ...
5
votes
2answers
3k views

Is it correct to use PUT with multipart content?

We are using Spring and want to implement a REST with a "override file" call so we think using PUT verb with a multipart body only to find that Spring don't accept it. My question is it can't be done ...
1
vote
1answer
73 views

List of Domains offering Web-mail services [closed]

I want to maintain a list of domain names that provide web-mail services. I searched and received a list of 1634 domains(Free Public web-mail services) However, is it possible to get updates, if any ...
0
votes
1answer
99 views

In NodeJS/ExpressJS, how should one decide between using request params and query strings?

While I am starting to get a hold of NodeJS programming, I am a bit confused by when to use request params and how their practical use differs from using query strings. In particular, I can do ...
3
votes
2answers
2k views

HTTP Query String vs URL Parameter for referral codes

I'm working with a Laravel app and am development a "referral" feature. A user clicks "refer friend" and a URL pops up that can be shared on Facebook etc, when another user clicks on the link they ...
1
vote
0answers
888 views

How to persist a session cookie in a PSR7 request/response middleware?

I am building a package that implements native-like sessions in a PSR7 middleware architecture. I created a middleware which is responsible to create and persist a session cookie. The session is also ...
1
vote
0answers
357 views

Best way to handle multiple proxies and HTTP requests

I need to develop a solution for a problem that requires multiple HTTP/ Socks proxies for different HTTP requests. The solution needs to be cross platform. Here is my idea how it needs to work: ...
4
votes
2answers
4k views

REST API - omitted properties in POST request: How should they be handled?

Given the following scenario: Teacher entity { "id": "1234", "name": "Mr. Didactic", "Subject": "History", "Classroom": "1A" } REST API endpoint: /teacher/id/1234 Let's say I submit a ...
3
votes
2answers
238 views

How are POST/PUT/DELETE data passed to APIs?

I know that the data is passed through HTTP, but I'm not sure if I should be passing data through HTTP headers, or HTTP bodies. Which one is the convention for APIs? Also, theoretically using PHP, ...
0
votes
2answers
1k views

How can I reduce http request while I have hundreds of images and thousands of users [closed]

I need an idea or concept how to reduce http request. Conditions: 1000s of users(android/iphone) active 100s of small images (150kb/image) to be fetched Simply by giving each image a hardcoded link, ...
1
vote
1answer
48 views

Preventing unauthorized writing to parts of server [closed]

Say I have two members which share a server. Both members have a game that is accessible to anyone and after playing, it records high scores by sending a request to write to a file on the server. ...
2
votes
1answer
1k views

Accessing internal API via Internal DMZ

I have an API that for firewall reasons can't sit on an internal DMZ and has to reside on the internal network. It was suggested that I build a 'shell' API that basically has all the same endpoints ...
3
votes
2answers
27k views

how do websites detect my screen resolution

http://whatsmyuseragent.com/ tells you your screen resolution, javascript enabled,user agent and local time etc? User agent is a part of HTTP header. How do they know about other information? I ...
0
votes
0answers
133 views

Should URL params and request params be stored in the Request object

Is it acceptable if GET parameters don't reside in the Request object, but in the URL? I am writing a small library in PHP, which represents the Request/Response as different entities and at moment ...
1
vote
1answer
144 views

How does StackExchange load data from the server without making an XHR request?

When viewing the questions for a tag on SE networks, every now and then you will get a message at the top: n questions with new activity. However the weird thing (to me) is that I don't see any ...
46
votes
3answers
39k views

What belongs in an HTTP request header vs the request body?

I'm working on a set of web services for a mobile client, and the requirements call for a unique device id to be included with all requests, to be stored in certain requests, and used to filter ...
3
votes
2answers
124 views

Does sending system-profile information with HTTP GET request conform to RESTful practices?

I'm using the Sparkle framework to update an app, and want to make use of the framework's ability to send system-profile information. The way this is done is by adding the information to the HTTP GET ...
2
votes
1answer
162 views

Purpose of authentication on API's?

After asking this question I found that I have a different question. What's the purpose of authenticating an API anyway? Take Twitter for instance. If you want to use this link to load some user's ...