Questions tagged [put]

1

votes
3

answer
603

Views

Is it a good restful URL design to avoid using DELETE and PUT?

I read an example of restful service, it only uses two HTTP method: get post. for example, there is a task list at the server. To design the restful URL, we can use: www.example.com/task GET. return all the task list. www.example.com/task/id GET. return the specific task. www.example.com/task/c...
Jimmy
1

votes
2

answer
1.5k

Views

Cannot PUT error in Node Express app

My get and post APIs are working, but for some reason my app.put isn't. When I hit localhost:3001/contacts/1 as a PUT in PostMan, I don't even see my simple console.log: app.put('/api/contacts:id', (req, res) => { console.log('req.params.id', req.params.id); res.json(contact); }); app.put app.put('/...
Leon Gaban
1

votes
2

answer
57

Views

Making PUT and GET Responses in Katalon Studio

I’m new in working with RESTful APIs. For my case I want to make an PUT Request and then GET it. I made an PUT Request and it worked. [1]: https://imgur.com/a/zlUTzYB But now I want to make an GET Request. Can I somehow make so that GET Request will automatically take PUT Requests statementId and...
brithwulf
1

votes
1

answer
36

Views

jQuery Put not working, but works with postman

I feel bad junking Stackoverflow with these junky questions, but with hours of looking for examples, I couldn't fix the problem. Here it is. I am trying to PUT with jQuery, my code is this $.ajax ({ type: 'PUT', url: 'http://localhost:3000/users/5a57adb130cdda747d2c4863', dataType: 'json', contentT...
1

votes
0

answer
90

Views

Design a restful idempotent update of a huge subset of a resource collection

Introduction This is a follow up to How to design a RESTful collection resource? . I think the main problem of bulk updates of resources (and bulk deletion) is still unsolved in the provided answers. Hence this new question. Let's suppose I have a collection resource of items http://example.com/item...
nCessity
1

votes
1

answer
150

Views

Angular PUT send option and that's it nothing else

So I have an Angular app with different call to a REST api to GET,POST work as intended they don't send any option preflight nothing but when it comes to put it's just hell, I couldn't find answer on google and I have tried every single header. At this point I just think PUT is not a real request......
John
1

votes
1

answer
37

Views

how to separate accepted status from 400 status in response.text

I'm getting two conflicting error messages from my PUT request. I'm using the Python requests module and a client.The response.text looks like this: {u'status': 400, u'errors': {u'error': u'We have identified 1 error in your request: (1) We could not download the URL'}, u'reference': u'4C7EC36B:...
topplethepat
1

votes
0

answer
16

Views

I need to block PUT request to server using apache2.2

Basically request is like http:///server/elements/planning?xyz where it updating my details which don't want to edit. How do I block that? Any suggestion is most welcome. I tried to add be below string in /sites-available/default but it blocks all the string. RewriteCond %{REQUEST_URI} '/server/ele...
Sagar Shetave
1

votes
1

answer
315

Views

upload artifact to artifactory with ant and curl results in empty file on server

I'm currently banging my head against this (wrong) behaviour. When I execute a CURL request in ant the upload results in a file with size=0 and when I execute the same request in the shell the file has the correct size. ANT target output: [echo] path.toFile=/home/marcel/gitrepos//source/.zip [echo]...
MarcelHodan
1

votes
1

answer
547

Views

Method not allowed (405) Must be one of: GET - Slim3 + Apache + AWS

I have been struggling with this for some time and don't know the what I am doing wrong. I am using Slim3 (with LAMP) behind an Apache server. HTTP GET and POST works just fine. However, PUT and DELETE throws this weird error. Method not allowed Method not allowed. Must be one of: GET And this is t...
Aryabhatt
1

votes
3

answer
496

Views

Angular 5 HttpClient Firefox PUT not executed but works in Chrome

Im creating a website right now using Angular 5 and CouchDB. In my database.service.ts a method looks like this: import {HttpClient} from '@angular/common/http'; const auth = my database adress; constructor(private http: HttpClient) {} createUser(id: string, email_: string, password_: string, firstn...
xxlbomber
1

votes
1

answer
46

Views

How to make batch (concurrently) PUT calls using RestEasy?

I am trying to make multiple PUT requests to a server and each of these are independent. Finally, all the response status codes are &&ed and function returns a boolean on success/failure. However, in this approach I have to wait for each response which increases the delay based on the number of put...
Destructor
1

votes
0

answer
179

Views

PutAsync Doesn't Send Message Body

I am just trying to send a body with JSON to the server. This is my code. var data = await SerializationAdapter.SerializeAsync(body); var bodyString = Encoding.GetString(data); var length = bodyString.Length; var stringContent = new StringContent(bodyString, Encoding, contentType); stringContent.H...
1

votes
1

answer
133

Views

Angular 5 HttpClient.put executes two requests

I'm building PWA with Angular 5. And having problem with duplicated execution of PUT requests. I'm also running POST and GET requests but this bug appears only with PUT. This is the method put(url: string, data: string): Observable { console.log('put'); const options = { headers: new HttpHeaders({ '...
1

votes
0

answer
265

Views

PUT request method not working retrofit 2 android

All request method is working fine, but PUT request method is never successful. Its working perfectly in 'Postman' with same parameters. My request calling interface @Multipart @PUT('api/v1/user/{id}/') Call updateUserProfile( @Header('Authorization') String token, @Path('id') int user_id, @Part('n...
demo_Ashif
1

votes
0

answer
43

Views

Ooyala custom preview image upload not working

I have some issues trying to upload an Ooyala preview image. I'm using a PUT request and I sign the request as suggested here. The issue is that when I make the CURL PUT request, I'm using CURLFile object and this won't work. $data['file'] = new \CURLFile($params['image'], 'image/jpg', basename($pa...
Irimie Andrei
1

votes
0

answer
22

Views

PUT method using python3 and urbllib - headers

So I am trying to just receive the data from this json. I to use POST, GET on any link but the link I am currently trying to read. It needs [PUT]. So I wanted to know if I was calling this url correctly via urllib or am I missing something? Request {'DataType':'Word','Params':['1234'], 'ID':'22'} Re...
Jay
1

votes
0

answer
55

Views

file_put_contents causes page to refresh

I am calling a file_put_contents() inside of a PHP script that is executed via AJAX. Whenever I execute this script the client page gets reloaded which is not desirable. Is there a way to prevent the PHP script from reloading the page? I have tried modifying the headers using the following and passi...
Matt Butler
1

votes
1

answer
218

Views

Angular Http PUT not sending request to Web-API

I have a c# WEB API using Entity Framework - I am trying to make a put request through my angular front end to simulate a 'checkin' function but the request isn't going through. Here is my Web api method [HttpPut('checkin/{id}')] [AuthorizeRoles(Role.Administrator, Role.User)] public async Task Chec...
rahulchawla
1

votes
0

answer
33

Views

Keeping Automatic Log of one week Transaction in PHP

Case: I have the following query for the INSERT Operation as: $sql = 'BEGIN -- pkg_transaction.set_transaction('' . $_SESSION ['user'] . '', 'INSERT EMPLOYEES'); -- insert into employees (EMPLOYEE_ID,FIRST_NAME,LAST_NAME,EMAIL, -- ADDRESS,USERNAME,PASSWORD) -- values ($id,'$first_name','$last_name...
DixonCh
1

votes
0

answer
190

Views

Ionic 3 Image Upload using put method

Need to Request: PUT to transfer an image from gallery or camera Android/IOS Like: return this.httpClient.put(endPointUrl, file, { headers: headers }) .catch((error: any) => Observable.throw(error)); Using ionic plugin add cordova-plugin-file-transfer npm install --save @ionic-native/transfer it u...
Amee Prajapati
1

votes
1

answer
182

Views

How to safely allow PUT for single program in Apache 2.4

I am using Magento (version 2.2.5) and I seem to need to allow PUT requests for my server (at least for the Magento program). For specifics, on Magento entering a discount code does not work on the checkout page fails '501 (Not Implemented)'. However the discount code section does work in the shoppi...
YWSW
1

votes
2

answer
941

Views

HTTP Requests, body vs param vs headers vs data

I am new to HTTP requests (GET, POST, PUT, ETC.) and I am having some issues understanding the 'anatomy' of these procedures. What exactly is the difference between the body and the data? Are they the same thing? Or are headers the same thing as the param? When authentication takes place, are the u...
DCS
1

votes
0

answer
51

Views

Prediction option put and call, FFT Method in python

I try to make prediction of option put and call with the FFT method, but i got some problem in my python code and i don't know what i have to modify. Can you help me ? options = pd.read_csv('/Users/Abenaya/Documents/relevantoptions2',sep =',',header = 0) print(options) x=[] for i in range (1,415):...
bibio95100
1

votes
3

answer
44

Views

PHP - appending JSON to existing file inside new category

Please, looking for little push over my problem. Having this script which append data to my existing JSON. What I am looking is: when I append new data it is create new $key (category) and set it all to JSON. Better to show on example. This is my code: function parseTag($content1,$tg) { $dom = new...
Jan Gabba Gabriel
1

votes
1

answer
71

Views

Make PUT call to external website using Rest Template

I'm currently trying to make a PUT call to my Gemfire Cache test enviroment https://gemfire.docs.pivotal.io/95/geode/rest_apps/put_update_data.html I've tried following a template like so RestTemplate restTemplate = new RestTemplate(); String url = 'http://localhost:8080/spring-rest/data/putdata/{id...
Hiya54 Huy
1

votes
0

answer
64

Views

Java JsonPath: modify multiple JSON attributes at once

I am struggling to modify several JSON objects, while using the JsonPath library. I have a selector, that gets declared at runtime and a JSON file of unknown size. I want to only modify the JSON objects, that match the filter’s criteria defines by the selector. In this example, all objects get a n...
Jonas_Hess
1

votes
1

answer
58

Views

Deleting or Updating posts in LARAVEL using controller

{!! Form::open(['action'=>['[email protected]',$post->id],'method'=>'POST']) !!} {{Form::label('title', 'Title')}} {{Form::text('title', $post->title,['class'=>'form- control','placeholder'=>'Title'])}} {{Form::label('body', 'Body')}} {{Form::textarea('body', $post->body,['id'=>'article ckedi...
Astrit Spanca
1

votes
0

answer
70

Views

Shopify PUT request failing with 404 on OPTIONS preflight

I am using AXIOS from within my app to access the shopify admin api. I am updating a customer with metafields (which, as I understand it, the storefront API does not support with graphql). I am receiving a preflight options error when I do a PUT. The error is a 404. The item I am trying to hit does...
Brian Edelman
1

votes
1

answer
39

Views

How to update JSON using same API Function .PUT request in Alamofire

I already gathered solution regarding my previous SO Question regarding How to use PUT request in ALamofire with this solution below. func updateParticipant(updateType: UpdateParticipantType, participantID: String, completionHandler: @escaping ( (_ result:Any?, _ error:Error?) -> Void)) { let updat...
Titus
1

votes
0

answer
18

Views

performance of two file fopen vs one big file fopen

i am trying to write in txt file and my data are comma separated numbers which are appended every time. i have two types of data which i am trying to compare so if we are using one txt file then it has to be written in new line . 1,5,10,15,22,32 other line is 1,5,7,12,8,99 so its simple data but...
Steeve
1

votes
1

answer
32

Views

Form method PUT in html with PHP

I'm trying to update the record through a html form. But I have a problem that when I click SUBMIT then if ($ _SERVER ['REQUEST_METHOD'] == 'PUT') {} is not activated. My form html: And PHP code: $idUpdate=''; $idUpdateErr=''; if ($_SERVER['REQUEST_METHOD'] == 'PUT'){ echo 'debug'; if(empty($_...
Name No
1

votes
0

answer
17

Views

how to send file with other form data with put request using request module in nodejs

Here is my code of put request requestMethodPutWithFormData: function (url, form_data, header) { return new Promise((resolve, reject) => { //SET ALL THESE PARATMETER TO MAKE REQUEST request.put({url: url, formData: form_data, headers: header}, function (error, response, body) { var responseData = JS...
user979879
1

votes
1

answer
74

Views

Update wiki page of tfs by calling rest-api

I want to update an already existing wiki page of tfs by using this document: https://docs.microsoft.com/de-de/rest/api/azure/devops/wiki/pages/create%20or%20update?view=azure-devops-rest-4.1 Creating a new wiki-page (with content) is no problem. That is working fine. But I want to edit an existing...
Alois
1

votes
2

answer
20

Views

How to fix put request from Heroku MEAN stack CRUD App tutorial

I followed this tutorial from Heroku for a MEAN stack CRUD app deployment. Create, Delete and Get all work. The only error I am receiving now is from Put. I am getting a 500 error when trying to update an object and not sure why. My code is below. //HTML ... Update //.ts file updateContact = (co...
Kenzo
1

votes
0

answer
55

Views

Streaming data in Ruby net/http PUT request

In the Ruby-doc Net/HTTP there is a detailed example for streaming response bodies - it applies when you try to download a large file. I am looking for an equivalent code snippet to upload a file via PUT. Spent quite a bit of time trying to make code work with no luck. I think I need to implement a...
Dan M
1

votes
1

answer
34

Views

i'm getting an error in my angular 6 http put request

here is my code products.service: updateCategorie(ucategorie: Icategorie) { const endpoint = this.url + 'api/Category/Edit'; const headers = new Headers(); headers.append('Authorization', 'Bearer ' + localStorage.getItem('access_token')); const options = new RequestOptions({ headers: headers }); con...
daniel
1

votes
2

answer
55

Views

Exception in executing httpclient with PUT request

I have to upload (PUT) a multipart data which includes a PDF/JSON file, some metadata and a header with authorization, but an exception occurs. I am newbie with multipart data and android, so if anyone can point out, where am I going wrong. private void documentUpload(String filePath, String docType...
Prashant Upadhyay
1

votes
1

answer
57

Views

Uploading to Google Cloud using a signed URL

I'm trying to generate download and upload link from the Google Cloud, to view and upload files, using the following code: public class Test { public static void main(String[] args) throws IOException { Storage storage = StorageOptions.newBuilder().setCredentials( ServiceAccountCredentials.fromStrea...
Roshan Upreti
1

votes
1

answer
51

Views

Writing data in a text file on server

I am trying to build a simple web page where a user is prompt to click on an image as many times as desired. Eventually, after user is done s/he should click a link saying 'I'm done' that should trigger the server to write to disk a sting (let's say: 'I clicked x times', which I can manage to get)....
AlonBR

View additional questions