question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PUT Method not working

See original GitHub issue

Hi,

i got problem when i’m using method: “PUT” when uploading file.

  Upload.upload({
      url: APIROOT + 'categories/' + $routeParams.id,
      data: data,
      method: 'PUT'
  }).then(function (response) {
       ResultService(response.data);
   }, function (response) {
       ResultService(response.data);
   }).finally(function () {
       $scope.loading = false;
       $scope.button_text = "Update";
   });

At my server i can’t receive the data. But if i change method to “POST” i can receive it properly.

Any solution?

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:14 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
stefensuhatcommented, Jul 14, 2016

I’ve got a solution and right now I’m still using it.

For example:

{file: 'abc.jpg'}

Add extra object to your data:

{_method: 'PUT', file: 'abc.jpg'}

Its working for me. tested on Laravel.

Now laravel will assume that you want PUT method.

0reactions
AmirTheHcommented, Jul 13, 2016

Same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

PUT method not working on API - Laracasts
"Method not allowed" means that you are trying to use the wrong HTTP request method on that route, e.g. sending a GET or...
Read more >
The problem with HTTP PUT method and possible ways to ...
In this post I'm going to focus on the problem related to HTTP PUT method. I will show by example Web API HTTP...
Read more >
Laravel 6.8 PUT Method not working, Showing Blank Page
You can get pointer into route file (web.php) but not into controller's Any function >>> That means pointer is not passing to controller....
Read more >
PUT - HTTP - MDN Web Docs
The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload.
Read more >
PUT method is not working - Kentico DevNet
I am able to use GET requests for existing contact and POST requests for creating new a contact but not able to get...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found