[web2py] Re: Handling OPTIONS request in a web2py RESTful API

2019-11-27 Thread mcamel
I think you have to add code to handle OPTIONS the same way is described in the manual for GET, POST, PUT, DELETE. In my case it worked just adding this: def OPTIONS(*args, **vars): return dict() El viernes, 10 de mayo de 2013, 13:47:05 (UTC+2), Daniel Gonzalez escribió: > >

[web2py] Restful api token based authentication login to CAS

2017-10-18 Thread Sharjeel Ali Shaukat
Currently i have two applications. 1st application is using as a CAS is on different server for the login in 2nd application. Now i want to create a rest service in 2nd application that can utilize the token to be created in 1st application after login any idea regarding this -- Resources: -

[web2py] Restful api for uploading files

2017-10-18 Thread Sharjeel Ali Shaukat
I want to create a restful api through which i can upload files to web2py application using android or other 3rd party applications. Any useful link or code would be very helpful -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source

[web2py] Restful API

2015-08-21 Thread Luis Valladares
Hello! I want to buid an applicaton using the microservices architecture, in order to do this i will implement some Restful APIs using web2py that will be accesed by my applications using HTTP request. This project will be a large scale application with a huge amount of request, so i need to op

[web2py] Re: web2py: RESTful API returns "invalid arguments" for any POST request with JSON body

2014-11-18 Thread Tomáš Slobodník
Ok, I tried to install Python 2.7.8 in my home directory on production server and error disappeared. Then I tried the same with Python 2.6.8 with same result - no error. Don't know what caused the error but my guess is some bug in Python 2.6.1. Dne středa, 5. listopadu 2014 23:37:03 UTC+1 Niphl

[web2py] Re: web2py: RESTful API returns "invalid arguments" for any POST request with JSON body

2014-11-05 Thread Niphlod
whoops, don't mind. I think it's this commit that I remember, but that was back when we had 2.5 support On Wednesday, November 5, 2014 11:27:40 PM UTC+1, Niphlod wrote: > > uuhm, I remember something going weird

[web2py] Re: web2py: RESTful API returns "invalid arguments" for any POST request with JSON body

2014-11-05 Thread Niphlod
uuhm, I remember something going weird with python 2.6 unpacking args and kwargs, but I really don't remember the specifics... some syntax worked in 2.6 and 2.7 while another only in 2.7 On Wednesday, November 5, 2014 11:12:11 PM UTC+1, Leonel Câmara wrote: > > Then I would guess it's some p

[web2py] Re: web2py: RESTful API returns "invalid arguments" for any POST request with JSON body

2014-11-05 Thread Leonel Câmara
Then I would guess it's some problem with your webserver configuration as there's nothing in Request.restful that wouldn't work with python 2.6 (although seriously 2.7 has been out for 4 years already). Have you tried without using https? -- Resources: - http://web2py.com - http://web2py.com/b

[web2py] Re: web2py: RESTful API returns "invalid arguments" for any POST request with JSON body

2014-11-05 Thread Tomáš Slobodník
Hi, I already tried this, but it didn't change the behaviour. Dne středa, 5. listopadu 2014 18:32:11 UTC+1 Leonel Câmara napsal(a): > > it should be > > def POST(*args, **vars): > return dict() > > Not > > def POST(**vars): > return dict() > -- Resources: - http://web2py

[web2py] Re: web2py: RESTful API returns "invalid arguments" for any POST request with JSON body

2014-11-05 Thread Leonel Câmara
it should be def POST(*args, **vars): return dict() Not def POST(**vars): return dict() -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issu

[web2py] Re: web2py: RESTful API returns "invalid arguments" for any POST request with JSON body

2014-11-05 Thread Tomáš Slobodník
Update: When I run the same code locally on pre-packed Rocket web server and Python 2.7.8, no error occurs. As far as I know, web2py should still support Python 2.6.1 running on my production server. Could this be a bug or incompatibitity with python/web server/server setting? Dne úterý, 4. li

[web2py] web2py: RESTful API returns "invalid arguments" for any POST request with JSON body

2014-11-04 Thread Tomáš Slobodník
Hi everyone, I run into the following problem when implementing RESTful API. I have this function in my controller: @request.restful() def prop(): response.view = 'generic.json' session.forget(response) def POST(**vars): return dict() return locals() When I use cURL with

[web2py] Restful API with HTTPS and authentication

2013-09-16 Thread Fredrik
Hi, I'm trying to set up a RESTful API in web2py and have run into some troubles with authentication. The server running the API is setup with WSGI, forced HTTPS and the API controller actions have the @auth.requires_login() decorators. The problem is that I'm not able to make requests to the

Re: [web2py] Re: Web2py Restful api authentication for android app

2013-06-07 Thread Saurabh Kumar
Thanks :) On Sat, Jun 8, 2013 at 12:36 AM, Christian Foster Howes wrote: > we are using a modified form of https://github.com/simplegeo/** > python-oauth2 modified to > make it run on GAE and also some tweaks in usage to handle some > special-case req

Re: [web2py] Re: Web2py Restful api authentication for android app

2013-06-07 Thread Christian Foster Howes
we are using a modified form of https://github.com/simplegeo/python-oauth2 modified to make it run on GAE and also some tweaks in usage to handle some special-case requirements. cfh On 6/7/13 11:26 , Saurabh Kumar wrote: Can you give pointers to the library you are using? On Fri, Jun 7, 201

Re: [web2py] Re: Web2py Restful api authentication for android app

2013-06-07 Thread Saurabh Kumar
Can you give pointers to the library you are using? On Fri, Jun 7, 2013 at 11:40 PM, Christian Foster Howes wrote: > for my resful APIs i use an oauth library to sign the requests. i then > use oauth as my authentication mechanism. > > > On Wednesday, June 5, 2013 5:29:23 PM UTC-7, Saurabh Kumar

[web2py] Re: Web2py Restful api authentication for android app

2013-06-07 Thread Christian Foster Howes
for my resful APIs i use an oauth library to sign the requests. i then use oauth as my authentication mechanism. On Wednesday, June 5, 2013 5:29:23 PM UTC-7, Saurabh Kumar wrote: > > Hi, > > I am writing an android app which has web2py as the server side backend. > What are the authentication p

[web2py] Web2py Restful api authentication for android app

2013-06-05 Thread Saurabh Kumar
Hi, I am writing an android app which has web2py as the server side backend. What are the authentication protocols while using Restful api from Java code. There are two scenarios: 1) HTTP (will need something like oauth2.0 ) 2) HTTPS (can do basic auth) Which is the best way for authentication

[web2py] Handling OPTIONS request in a web2py RESTful API

2013-05-10 Thread Daniel Gonzalez
Hi, I have implemented a RESTful api in web2py which handle the usual GET, POST, PUT, DELETE. (using @request.restful()) Is there a standard mechanism in web2py to implement OPTIONS requests? Thanks, Daniel -- --- You received this message because you are subscribed to the Google Groups "we

[web2py] RESTful api and JSON POST data with curl

2013-04-18 Thread Brent Zeiben
Hi, I am using a python script to organize some data and try to send it into web2py via the @request.restful() api. In the python script the text is mainly input from a free form text field. ( I believe some Unicode characters are in there as well, however I remove everything that is ord 128

[web2py] restful api :field behaviour change

2013-01-18 Thread DenesL
Hello all, currently the :field placeholder in a restful pattern will retrieve said field only for the first record from the resulting set. I believe that this should be changed so that it retrieves the field for all records in the set. To illustrate using the latest trunk, this pattern (note

Re: [web2py] restful api post works great localy, but getting login redirect on a remote server

2012-10-16 Thread Adi
Could I please ask someone with Apache/mod_wsgi to test this code? Everything works fine on a local rocket webserver, and also on nginx, but for some reason when it runs on Apache returns "Not authorized". I just can't figure out where exactly is the problem. Same Apache server runs several we

Re: [web2py] restful api post works great localy, but getting login redirect on a remote server

2012-10-11 Thread Adnan Smajlovic
Thanks Massimo for looking into this. ticket opened: http://code.google.com/p/web2py/issues/detail?id=1080&thanks=1080&ts=1349992678 On Thu, Oct 11, 2012 at 5:05 PM, Massimo Di Pierro < massimo.dipie...@gmail.com> wrote: > Please open a ticket about this and I will look in detail asap. > > > On

Re: [web2py] restful api post works great localy, but getting login redirect on a remote server

2012-10-11 Thread Massimo Di Pierro
Please open a ticket about this and I will look in detail asap. On Thursday, 11 October 2012 09:44:04 UTC-5, Adi wrote: > > Tried 2.09 nightly build on a completely different (redhat) server and > still getting redirect, while post works as expected on a local rocket. > > Any hint where to look

Re: [web2py] restful api post works great localy, but getting login redirect on a remote server

2012-10-11 Thread Adnan Smajlovic
Tried 2.09 nightly build on a completely different (redhat) server and still getting redirect, while post works as expected on a local rocket. Any hint where to look for a problem please? using: curl --user webserv...@domain.com:pass -d "FirstName=Tim5&LastName=Json"http ://crm.domain.com/api/cus

[web2py] restful api post works great localy, but getting login redirect on a remote server

2012-10-10 Thread Adi
This is an example from book, where authentication and posting into database work good on a local server. Once I moved the code to production redhat linux server, where we have routes.py as bellow all I get as result is a login redirect: You are being redirected here If I remove authentication

[web2py] Re: xml generated by web2py restful api

2012-03-20 Thread castanets
Massimo Di Pierro writes: > > > Can you show us your code?On Tuesday, 20 March 2012 05:26:47 UTC-5, castanets > wrote: > restful api generated xml like as below :1 is there any method that the result is changed like this? : 1 > Thanks. > > > > > > > ★.co

[web2py] Re: xml generated by web2py restful api

2012-03-20 Thread Massimo Di Pierro
Can you show us your code? On Tuesday, 20 March 2012 05:26:47 UTC-5, castanets wrote: > > restful api generated xml like as below : > > 1 > > > is there any method that the result is changed like this? : > encoding="UTF-8"?>1 > > > Thanks. > >

[web2py] xml generated by web2py restful api

2012-03-20 Thread castanets
restful api generated xml like as below : 1 is there any method that the result is changed like this? : 1 Thanks.

[web2py] RESTful API: hook before controller is called ?

2012-03-19 Thread sebsto
Hello, Still developing around the RESTfull API. I am looking for a way to handle the HTTP POST payload *before* the controller is called. I want my REST clients to send encrypted and compressed content. I would need to decipher and decompress the content before the args parsing is done. Any su

[web2py] RESTful API : at ...> is not JSON serializable

2012-03-18 Thread sebsto
Dear All, I am new the web2py and trying to use the relatively new RESTful API, as described at http://web2py.com/books/default/chapter/29/10#Restful-Web-Services I am testing it with a very simple model : db.define_table('message', Field('sender', required=True), Field('recipient', requ

[web2py] RESTful API error: "no matching pattern"

2011-11-28 Thread Oliver Lade
I've been following the documentation regarding RESTful web services (very cool), and it mostly works except for one annoying thing. Every time I try a URL that's supposed to match the whole table and return all results (e.g. http://127.0.0.1/myapp/default/api/persons.json in the example) I get an

[web2py] Re: POST with web2py RESTful API

2011-08-09 Thread Massimo Di Pierro
In the above code if you pass a list of vars explicity: def manage_dog(): def PUSH(dog,name,age,birthdate): db.dog[dog].update_record(name=name,age=age,birthdate=birthdate) return dict() return locals() It would work with PUSH http://?name=...&age=...&birthdate

[web2py] POST with web2py RESTful API

2011-08-09 Thread Tiago Rosa
Hi folks, I'm trying to expose some of my app's data through a RESTful API and I'm having some trouble using the POST method. In this post (http://www.reddit.com/r/programming/comments/g5hxq/ web2py_trunk_has_a_new_restful_api_that_writes_db/) and video Massimo introduced web2py's RESTful API wit

[web2py] restful api

2011-05-23 Thread Tiago Moutinho
Hi, I have in my databse 2 tables: blog_post(id, name, slug, description) and blog_comments(id, post_id, comment). I want to use the restful api to for example list all comments for a given slug from blog_post. It is possible? With patterns i can not do that. Other question: Can i do a patter