FAQ Database Discussion Community


Map put not working Java

hashmap,put,jsonobject,linkedhashmap
I have a Map with some values, and I need to put a new entry into it, the problem is that the put "lost" the Object, and I have only the new Key into it. Here is the code public void addSeries(SerieInterface serieObject) { Map<String, Object> series = this.getSeries(); if...

Calling PUT method from Javascript

javascript,c#,web-api,put
I'm trying to call my C# Web API from javascript, and the data doesn't appear to be passing correctly. The GET method I have works perfectly fine, but I can't seem to get the PUT working as I intend. Here's the structure: Javascript: $.ajax({ type: "PUT", url: "/api/FTP", data: "Hello...

Ajax PUT call resulting in illegal invocation error

javascript,jquery,ajax,xml,put
I'm trying to modify an existing xml document that i stored from an earlier ajax call into a global variable named "XML". Now, im trying to change a title in the xml document to be whatever the user wants to change it to. For some reason i keep getting "uncaught...

Laravel form html with PUT method for PUT routes

forms,laravel,methods,routes,put
I Have this in my routes : +--------+---------------------------+--------------+--------------------------- ---------+----------------+---------------+ | Domain | URI | Name | Action | Before Filters | After Filters | +--------+---------------------------+--------------+--------------------------- ---------+----------------+---------------+ | | GET|HEAD / | | postcontroller | auth | | | | GET|HEAD login | | [email protected] | | | | | POST...

HTTP Put request Android REST API

android,rest,http,login,put
I am fairly new to Android development, and my current task is to implement a simple login activity that verifies an email/password combination with a REST backend service. I have the layout configured, as well as the values for the EditText email and password in my activity class, but I...

Should PUT request be used to delete a resource?

rest,http,put
I have a situation where I don't know how to manage it. I have a resource that has a flag "undeniable." Denying a post, would delete it from the database, so using DELETE /v1/posts/post-id-here would have been just fine; this way the undeniable post would have been just ignored with...

R - write() a file to a SAMBA share

r,file,put,samba
I have a file loaded in R that I want to move to a samba share It is something like write(some-file, file = "|smbclient -U user //ip password") It connects to the samba but then (I think) the output is "executed" in the smb: \> and I don't want the...

How do I use a function within the PUT function in SAS

types,format,sas,put
How do I print out the format of a variable of interest? Note i've simplified my example %let var_ = '1sep2014' %put | VARTYPE(&var_) I'd expect this to return the format type in the log but it just returns | VARTYPE(&1sep2014)...

Retrofit updating class PUT error code 301

android,rest,retrofit,put
Maybe this is a silly question but I've been stucked on this for a while. I'm implementing some methods for a restApi. I'm using retrofit and I'm trying to update a client information. To do an update I'm using PUT method but I don't know why I'm always getting a...

Bad request using file_get_contents for PUT request in PHP

php,rest,google-app-engine,put
This api call works fine using Postman (a REST Client), but when making the request on the server in my GAE application I am currently getting the following error: HTTP request failed! in C:\Projects\app\file.php on line 26 failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in C:\Projects\app\file.php...

Rails updates with contenteditable

ruby-on-rails,ruby-on-rails-4,put
My controller builds an index that nicely tabulates a whole lot of its content. I have made each td contenteditable. Onblur, I would like to submit updated data. In order to find the correct row, I have given each tr the model's id (as a name) but I only want to...

undefined method `refreshProfile_affinity_path' for #<#:0x8dbdc30>

ruby,ruby-on-rails-3,updates,put,undefined-function
I'm getting the error in the title. I am not sure how exactly to write the routes, controller, and index. I am trying to create a 'Refresh' button in an index.html.erb view shown below: ... <td><%= link_to 'Refresh', refreshProfile_affinity_path(a), method: :put %></td> ... It is using this route in routes.rb:...

play framework: understanding web services : post()/put()/get()/delete()

post,playframework,get,delete,put
So i am trying to understand how web-services work and i think i need some help with my controller. For example, i am trying to add a user into my data base ... This is what i have: public static Result addUser(){ DynamicForm form = Form.form().bindFromRequest(); String url = "http://my-url-qqq";...

SQL Query to merge two tables with different timestamp as index

mysql,sql,put
I am not sure if my question will work with a sql query. I have the two following Mysql tables: Table a: The table get every 20 second a new Value a.Time a.Value 2015-05-14 07:36:36 49 2015-05-14 07:36:56 49 2015-05-14 07:37:16 49 2015-05-14 07:37:36 49 2015-05-14 07:37:56 50 2015-05-14 07:38:16...

Should all the fields of a resource and its related resources be passed in a REST API PUT request?

rest,put
Let's say I have a ticket & comment resource. Tickets can have many comments. In your update endpoint HTTP PUT /api/tickets/<ticket_id>/ , should I require the client to pass all the fields of a ticket + ALL its comments when updating a ticket? I asked some developers and some of...

convert curl request into URLConnection

java,http,curl,put
I have this cURL request: curl -H 'Accept: application/vnd.twitchtv.v3+json' -H 'Authorization: OAuth <access_token>' \ -X PUT https://api.twitch.tv/kraken/users/<bot_name>/follows/channels/<channel_name> I need to turn it into a Java URLConnection request. This is what I have so far: String url = "https://api.twitch.tv/kraken/?oauth_token=" + bot.botOAuth.substring("oauth:".length()); URL obj = new URL(url); HttpURLConnection conn = (HttpURLConnection) obj.openConnection();...

how to send JSON data to an API using PUT method via cURL/PHP

php,json,curl,put
I am trying to connect to an API using cURL/PHP. I need to PUT a method to this API while sending JSON data. Here is my parameter $data = array('__type' => 'urn:inin.com:connection:workstationSettings'); Here is how I am doing the cURL call private function _makeCall($method, $uri, $data = false, $header =...

Web API Controller not found on PUT

jquery,asp.net-mvc,asp.net-web-api,asp.net-mvc-5,put
I am having trouble finding the put action of a web api 2 controller. I'm using MVC5. The GET action in the controller is found and is working well when called. I have tried several different ways of hitting this, but to no avail. I would appreciate any hints. The...

Questions on proper REST api design specifically on the PUT action when updating a resource

rest,http,put
I'm creating a REST interface (aren't we all), and I want to UPDATE a resource. So, I think to use a PUT. So, i read this. My take away is that i PUT to a URL like this /hc/api/v1/organizer/event/762d36c2-afc5-4c51-84eb-9b5b0ef2990c with a payload, then a permanent redirect to the URL that...

What's the most common expected behavior for a PUT on a JSON based REST API? A document replacement or a partial update)?

json,api,rest,http,put
I know there's a whole RFC for HTTP methods but I was wondering what would be the expected behaviour from a PUT to a REST API that responds with Content-type: application/json and accepts JSON encoded bodies. Is it expected to replace the document entirely with the new JSON object passed...

PUT request not working, Flask-RESTful, SQLAlchemy

flask,sqlalchemy,flask-sqlalchemy,put,flask-restful
I believe the issue is with committing the changes to the database (3rd to last line: db.session.commit()). For example take a user: username="Foo", email="[email protected]". If in the PUT request body I put {"email":"[email protected]"}, printing 'user.email' after the assignment reveals that the value is in fact changed. Afterwards however, upon querying...

Unit Testing a Put With Entity Framework

c#,.net,unit-testing,dbcontext,put
I am attempting to unit test a PUT Request by checking values. However, I run into one simple issue. I have a test context like such: class TestAppContext : ContextInterface { public DbSet<User> Users {get; set;} public DbSet<Request> Requests { get; set; } public TestAppContext() { this.Users = new TestUsersDbSet();...

Starring a repository with the github API

github,put,github-api
I'm trying to star a repository using the GithubAPI. This is done via a PUT request to /user/starred/:owner/:repo. I attempted to implement this feature in python using the requests library, but it isn't working. Here is a minimum working example: The constant are defined as GITHUB_API = api.github.com, GITHUB_USER =...