Questions tagged [http-request]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
1answer
101 views

REST: upload binary data with PUT method

I have an restful app that uses PUT to replace existing data. For example, there's a user management url https://myserver/users, and to replace user data, for example, to change the name and the ...
8
votes
1answer
35k 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 ...
1
vote
1answer
83 views

What constitutes “identical” for the purposes of HTTP idempotence?

From RFC 7231 "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content" Section 4.2.2 "Idempotent Methods": A request method is considered "idempotent" if the ...
1
vote
1answer
76 views

Where to include a pfx certificate in a http request?

I would like to understand what happens in a request which includes a .pfx certificate to authenticate to client to the server. I know how to implement this in python or use it in postman, but I don't ...
2
votes
1answer
85 views

How do I send data to HTML page only when a POST endpoint is hit?

I've looked through similar questions and tried to Google what I'm trying to do, but I haven't found anything concrete. What I'm trying to do: where I work, we use an HMI/SCADA system that displays ...
1
vote
1answer
485 views

Typescript and Angular 6 - Mapping Service Results to Data Transfer Objects

I think I am just look for a bit of code review advice. It might possibly be a methodology question? Essentially when I am pulling data (usually from a REST request), I generate a service, then ...
64
votes
10answers
13k views

How do I mitigate a scenario where a user goes to pay, but the price is changed mid-request?

This is kind of similar to the Two Generals' Problem, but not quite. I think there is a name for it, but I just can't remember it right now. I am working on my website's payment flow. Scenario ...
0
votes
0answers
30 views

Gateway aggregation is only for microservices?

I started to work in an existing Angular app that consumes a monolithic Web API writen with .NET CORE. This API has dozens of controllers(routes). In one of the main screens, when one specific event ...
574
votes
1answer
72k views

Is the use of “utf8=✓” preferable to “utf8=true”?

I have recently seen a few URIs containing the query parameter "utf8=✓". My first impression (after thinking "mmm, looks cool") was that this could be used to detect a broken character encoding. So, ...
-1
votes
1answer
47 views

Would it work to use http patch more general and even “unpatch”?

Is it a good idea to make http patch more general and also create a new property or even a new persistent entity if it does not exist. The patch could be general and send http body for different ...
9
votes
5answers
868 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 ...
2
votes
1answer
89 views

Application for forwarding data from websocket to HTTP method

I have a Raspberry Pi with a ConBee 2 (ZigBee) interface connected. The ConBee provides a websocket I can connect to to get push notifications on sensor changes. And I want to forward those ...
2
votes
1answer
82 views

best way to create @PUT upon multiple entities and compatible with RFC

I am trying to build the best PUT possible that allows modifying multiple entities upon single requests using java jersey. The idea is to send a request with multiple entity ids as @PathParam values ...
2
votes
1answer
93 views

Does it make sense to qualify an error as an HTTP error without an HTTP client-server communication

I am writing a C# client SDK to a REST Api. This SDK sends JSON-serialized models to the API, and implements a first level of verification of the parameters. If the verification fails, it throws an ...
1
vote
1answer
147 views

Which HTTP code has higher priority: 403 or 415?

Let's consider the following scenario. I need to access a resource hosted on server X. I want to get this resource in a Y format, so along with my request I send the Accept: Y header. Unfortunately X ...
-2
votes
4answers
2k 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 ...
2
votes
1answer
74 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
181 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
78 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 ...
162
votes
7answers
88k views

How do searches fit into a RESTful interface?

When designing a RESTful interface, the semantics of the request types are deemed vital to the design. GET - List collection or retrieve element PUT - Replace collection or element POST - Create ...
0
votes
0answers
75 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
247 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
411 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 /...
80
votes
6answers
108k 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 ...
1
vote
0answers
181 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,...
1
vote
1answer
161 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
6k 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
170 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 ...
0
votes
3answers
184 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
2k 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
240 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 ...
10
votes
2answers
6k 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 ...
1
vote
2answers
4k 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
260 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 (...
62
votes
3answers
57k 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 ...
6
votes
2answers
653 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
3k 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
1k 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
142 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
834 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 ...
6
votes
2answers
7k 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
2k 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 ...
0
votes
1answer
88 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
150 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
48 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 ...
2
votes
1answer
897 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 ...
1
vote
0answers
846 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
2answers
145 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
4k 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
76 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 ...