372 questions
1
vote
1
answer
145
views
Why is my patch request being blocked despite PATCH being allowed by the server's CORS policy?
The Gist API explicitly allows any * host and the PATCH method:
access-control-allow-origin: *
access-control-allow-methods: GET,PUT,PATCH,OPTIONS,POST
However, when a PATCH request is issued from a ...
0
votes
1
answer
130
views
.NET Core 8 site on IIS 10 rejecting PATCH, PUT, DELETE requests
I've been adding an API to a .NET Core 8 website. When I run it locally in IIS Express out of Visual Studio, all the PATCH, PUT, and DELETE requests work. When I deploy to IIS 10 on a server, they're ...
0
votes
1
answer
48
views
Safe (HTTP Methods): POST with certain MIME types?
From MDN (Archive):
for HTTP request methods that can cause side-effects on server data (in particular, HTTP methods other than GET, or POST with certain MIME types), the specification mandates that ...
0
votes
1
answer
54
views
Send IformData as a field within Postman
This is my postman setup;
for the request object;
public class UploadRequest
{
public List<IFormFile> File { get; set; }
public int EntityType { get; set; }
public ...
0
votes
2
answers
67
views
In Flask, my custom endpoint returns 404 in HTML despite having a JSON response
When trying to curl this endpoint with curl -X GET -i localhost:5000/person/66c09925-589a-43b6-9a5d-d1601cf53287
the implementation works fine:
HTTP/1.1 200 OK
Server: Werkzeug/3.0.3 Python/3.12.3
...
-2
votes
2
answers
195
views
Why can I test the delete method perfectly in Postman but not in the browser? [closed]
I found that my HTTP delete request runs perfectly when I test it in Postman. However, when I try to test it in the browser, I receive a 'Cannot GET /account/delete/Julieth' error. I managed to ...
0
votes
1
answer
392
views
Should i use GET or POST for request with body in DRF?
I am relatively new to the web development and I am writing backend for webapp for practicing chemical elements and compounds and their formulas in our school. I am using Django and Django Rest ...
-1
votes
1
answer
222
views
Which HTTP method is correct for RPC over HTTP triggering asynchronous action eventually changing server status? [closed]
We are using HTTP protocol to trigger an asynchronous action on the web server, which later in the background loads data from another server and writes them into our server's database.
┌──────┐ ...
0
votes
1
answer
68
views
What HTTP method should a route have if it's for create_or_delete
Yea I know it's such a strange purpose create_or_delete. But I have an attendances table for users, and in the frontend there's a checkbox,
when it's checked -> create an attendance record
when ...
0
votes
1
answer
71
views
Which url name should be used for api performing the membership withdrawal function
Q1. Is it okay to use the word "deregistration" in the API specification,
or should I use "signout"?
Which one is better?
Q2. And I wonder if the actual logic of membership ...
1
vote
1
answer
332
views
Why does it return status code 405 instead of 401 unauthorized? [duplicate]
Here in my ASP.NET Core 6 Web API project, when I try to make a request to an authorized endpoint and I'm not authenticated, the API returns a status code of 405, but isn't it supposed to return 401 ?
...
0
votes
1
answer
370
views
how to remove "Request method 'GET' not supported' error from the screen in java
When i access the URL api in the browser, i get this error in the screen:
Request method 'GET' not supported
What i want is to completely remove this error when i access the url directly in the ...
1
vote
1
answer
181
views
How do I properly pass an group ID parameter into the GroupMe API
I am trying to return a specific group by ID in GroupMe using Python. The official documentation states that, to get a specific group, you append the base URL with /groups/:id and add the group ID ...
0
votes
1
answer
78
views
Handle HEAD request with CefSharp
I am evaluating CefSharp to build a desktop application which basically only wraps a web application. To access files from the file system I want to intercept http requests of the web app.
I adapted ...
-1
votes
1
answer
81
views
Best Practices for retrieving data in MVC: Concerns about Using POST for Retrieval and Token Handling [closed]
I'm currently working on a MVC app. I've implemented a route using a POST method to retrieve information and navigate to the corresponding page, and I have some concerns about the design practices I'm ...
2
votes
1
answer
161
views
How to access the HTTP method within a Ballerina request interceptor
I'm working with Ballerina and I've implemented a request interceptor for my HTTP service. In this interceptor, I need to access the HTTP method (GET, POST, PUT, etc.) used in the incoming request.
I'...
1
vote
0
answers
14
views
I am getting casting exception while using delete .method of HTTP
EXCEPTION ::"class java.lang.Integer cannot be cast to class java.lang.Boolean (java.lang.Integer and java.lang.Boolean are in module java.base of loader 'bootstrap')"
@RestController
public ...
2
votes
0
answers
159
views
Does Google Cloud Run allow non-standard HTTP methods?
I created a HTTP API on that uses the non-standard QUERY method. It works fine locally but on Google Cloud Run, every QUERY request gets a 502 response. Making the exact same request with POST works ...
1
vote
0
answers
104
views
Thunderclient api testing get error:Cannot get /api/users data
I got my data for login and register successfully but I am not getting my data after using get request.I don't understand why; can anyone help?
I want that when I use get method, I should get my data ...
0
votes
1
answer
85
views
Swift API token retrieval: httpMethod set to POST, but keeps throwing a GET error
I'm trying to get a token back via the Nordigen API (https://ob.nordigen.com/api/v2/token/new/).
However, despite setting the httpMethod = "POST", I keep getting a 405 back stating :
"...
-1
votes
1
answer
94
views
Cannot POST / - URL with parameters [duplicate]
I'm trying to post something, but always get error.
articlesRouter.post('articles/:target', async (req, res) => {
const target = req.params.target.replaceAll("_", " ")
...
-2
votes
1
answer
379
views
Spring Boot Difference usages of HTTP Methods
I am using Spring Boot for creating rest API. I learnt about PUT, PATCH, POST. PUT is for updating the resource and if Id is not present then it creates. Patch is for updating part of the resource and ...
0
votes
1
answer
197
views
How to config data header axios.pos using data from axios.get?
The first axios.get is getting data from local server and then pass into axios.post into 3rd party server.
If i pass 'data' (hardcoded) into axios.post, 3rd party server send back response as success ...
-1
votes
1
answer
170
views
Options request throws AssertionError error in Django REST Framework
I have the following Viewset:
class My_ViewSet(viewsets.ModelViewSet):
serializer_class = My_Serializer
queryset = My_Object.objects.all()
def list(self, request):
# The code here ...
1
vote
1
answer
277
views
What HTTP methods should be chosen in a REST API when no CRUD operations are going to be performed?
Lets consider a REST API for a backend application that does not have any DDBB dependencies or connections.
For example, a python backend app which uses a machine learning model binary that takes a ...
-1
votes
1
answer
326
views
PHP HTTP Proxy - How to create a tunnel after a CONNECT request
I've created an HTTP Proxy with PHP. It works well for simple HTTP requests where it receives the request, passes it to the target, passes the target's response to the client and closes the connection....
0
votes
1
answer
697
views
PATCH method with enum value doesn't work with Postman but works with browser
Here is my Spring Controller with the @PatchMapping :
@PatchMapping("/mode/{numClient}")
public Response<Object> mode(
@PathVariable Integer numClient,
@RequestBody ...
0
votes
1
answer
45
views
Why DRF uses PUT to send files?
I'm trying to understand how file management works in Django Rest Framework, and a question lingers in my mind: Why does Django use PUT to update files? Is it possible to do the same with the PATCH ...
2
votes
1
answer
395
views
security-constraint in web.xml not working with http-method - Tomcat in a Docker container
I have read several of the other answers and have tried a couple of suggestions, but no matter what I have tried to this point I am unable to exclude OPTIONS as an allowed http-method for TOMEE/TOMCAT ...
0
votes
1
answer
1k
views
Why am I getting a 405 response to a DELETE request even though I allow that method in my CORS config?
I have a Blazor WebAssembly and C# web API hosted on IIS and
When trying to send a PUT or DELETE request to my API I get this cors error:
While i have this in My Program.cs:
This is the response ...
0
votes
1
answer
601
views
How to read data using POST method instead of GET in Postman?
I've been told to use POST method to read data instead of the GET method. The tool I'm using is Postman. How can I use POST to fetch data/resources from the server?? I'm testing using any of the ...
0
votes
1
answer
923
views
How can I set http method in servlet filter(in context of Spring Framework)?
I have got a such issue: I do have got antMatcher in Spring Security. And I have an opportunity to set http method GET/POST/PUT/PATCH/DELETE for url mapping for my filter. So requests with some ...
0
votes
0
answers
2k
views
Is it ok to use multiple HttpClient instance?
I am using .NET Framework 4.5. I can't able to use IHttpClientFactory , so I decided to use single static HttpClient instance but the problem is ,if I add a Header to Client for one request it affect ...
0
votes
1
answer
452
views
symfony form submit breaks when method DELETE is used
In symfony 3 this code below worked fine. Upgrading to symfony 5 it doesn't.
Controller:
public function deleteAction(Request $request, ACRGroup $aCRGroup)
{
$form = $this->...
1
vote
1
answer
811
views
API is responding with status 200 when used with HEAD and OPTIONS method
I created an API with method GET using express which is working fine.
following is the API
app.get('/healthcheck', (_req, res) => {
res.status(200).send({
state: 'Healthy',
timestamp: new ...
0
votes
1
answer
526
views
Django with Javascript fetch API: POST works but all other unsafe methods are forbidden
I am working on this CS50W project.
When using the fetch API to send POST requests to the server, everything worked fine.
After I changed the method to PUT, or any other unsafe methods, things stopped ...
0
votes
1
answer
3k
views
Browser claims No 'Access-Control-Allow-Origin' header is present on the requested resource
EDIT2: GETs don't send JSON data. That's my problem. Working on sending it at URL data. It's not letting me delete this post either.
EDIT: I figured out that it's not a preflight problem using ...
1
vote
2
answers
1k
views
HttpClient Get with file in body
I have to call an external API via a HttpGet that requires me to send a file in the body. I realize that this is a bad API design but since it's external, I have no influence over it and cannot change ...
0
votes
1
answer
453
views
How to successfully run Golang program with an http.Get calls - On Windows with MalwareBytes running?
ETA. Okay, based on some advice I'd received, I used go build main.go rather than go run main.go
This puts the main.exe in my project folder (which I excluded) rather than putting a temporary main....
1
vote
1
answer
2k
views
HTTP response status for unknown (nonexistent) HTTP method
Let's say I've got route /posts. It only implements GET HTTP method.
If someone tries to access it with different, existing method (POST, PUT, etc.) I return 405.
What should I return in case someone ...
0
votes
1
answer
1k
views
Response to TRACE http method
So I was testing my website and I tried connecting with the TRACE http method. In response I got a massive string. I don't know what it is. Does anybody know what could it be and if it's some sort of ...
1
vote
0
answers
253
views
HTTP-Methods understanding: Why does the documentation use PUT instead of POST in this AWS API Gateway Integration?
In a project, we are using AWS Kinesis Firehose for Data Ingestion.
To access it from the Browser and without Authentication I set up an AWS API Gateway to set up a public endpoint. To Ingest Data ...
1
vote
2
answers
4k
views
What HTTP method should I use for an endpoint that updates a status field of multiple entities
I like to use the correct HTTP methods when I'm creating an API. And usually it's very straightforward. POST for creating entities, PUT for updating them, GET for retrieving etc.
But I have a use-case ...
0
votes
1
answer
3k
views
how to update the records in angular without using "id" in put method
I am developing the mobile recharge website using angular,angular material,springboot ,this code is for admin, who can able to update the plans in website. And the problem is with the edit option. ...
0
votes
1
answer
2k
views
How to set HTTP OPTIONS Method in Cloudflare only to allow GET and POST
I have Cloudflare free SSL enabled on a website and I need to change the HTTP OPTIONS Method to allow only GET and POST.
I've used this command in SSH to check what methods are available:
curl -X ...
3
votes
1
answer
387
views
REST - PUT and newly introduced field
This is a followup of an older question.
I have a resource Car which have fields plate and color.
We have a REST client updating all the fields of the car:
PUT /cars/:id
{
plate: "ABC-1234"...
8
votes
1
answer
2k
views
VTTEST and MOZILAVT HTTP methods, what are these?
I got several alerts in the last two days bcs our service responded 5xx in a large percentage of the requests (tipically offhours when we have zero to low traffic anyway).
When I checked the ...
0
votes
2
answers
2k
views
ASP.NET Core 5.0 Web API throws error 405 when trying to delete record using HttpDelete
I'm building an ASP.NET Core 5.0 Web API application as I mentioned in the title I have an issue when trying to delete a record from the database; I'm getting an error 405 Method Not Allowed response ...
0
votes
1
answer
465
views
How does a pre-flight request receive headers without having a response?
I've been reading about CORS and pre-flight requests, and have understood that basically it is a type of an OPTIONS request that is sent before making the actual request and if the server permits it ...
3
votes
1
answer
4k
views
Login user via GET (basic auth header) or POST
I've been doing some HTTP methods and header research recently if we should use GET with basic authorization instead of POST when submitting?
HTTP Methods
The GET method requests a representation of ...