[완료]RESTful web service 를 손쉽게 만드는 방법이 있나요?

tomahawk28의 이미지

php, mysql, extjs를 써서 웹 프로그램을 만들었는데요. extjs가 3.0 이 출시되면서 RESTful 이라는 개념을 사용하기에 예제를 보니
저한테나 다음사람에게 인수인계하기도 편할것 같더라구요.

예를들어 어떤 특정 사람의 주소 레코드를 하나 생성 한다고 치면 지금까지는 Ajax로 서버페이지에 다음과 같은 예제를 전송해줬습니다,

{personId: 12, order: addAddress, street: edstr, city: stt, plz: 73737}

하지만 RESTful을 쓰면

URL: http://local/person/12/address
data: {order: addAddress, street: edstr, city: stt, plz: 73737}

해당 URL로 접근해서 data를 POST로 전송해 주면 완성되는 것인데요,
제가 생각 할때는 django를 쓴후 django-rest-interface(http://code.google.com/p/django-rest-interface/wiki/RestifyDjango)
를 활용해서 할 생각이었거든요, 나머지 php기반 restful framework들은 복잡하더라구요 -_-;
혹시 Restful 구축해보신 분이나 관심있으신 분들은 해당 API를 어떻게 구축을 하면 좋을지 답변 주시면 감사하겠습니다.

dragonkun의 이미지

Rails 같은 경우는 스캐폴딩을 이용해 만들면 자동으로 REST 요청을 처리해 줄 수 있는 컨트롤러를 만들어 줍니다.

Routing에 관한 지원이나 MIME 타입과 ActionController 의 respond_to 메소드 연동 등.
현재로써는 RoR 만큼 RESTFul 한 서비스를 만들기 쉬운 방법은 없을 것 같습니다.
---
Emerging the World!

Emerging the World!

brucewang의 이미지

저도 오픈소셜 관련 작업을 하다가 레일스에서 조금 볼 기회가 있었는데요,
OAUth의 인증 관련 부분을 제한다면 결국 Post/Get 리퀘스트/리스판드의 json파싱이 거의 전부가 아닐까 싶더군요.

결국 어떤 프레임웤이 되었건 HTTP 요청/응답 수행레이어에 직접 json 생성/파싱 루틴을 붙여서 파싱의 경우 그 결과를 해당 프레임웍에서 유용하게 사용할 수 있는 오브젝트로 생성시켜주면 좋을 것 같네요.

-------------------------------------------------
$yes 4 8 15 16 23 42

-------------------------------------------------
$yes 4 8 15 16 23 42

tomahawk28의 이미지

두분 다 rails를 추천해 주셨는데 다뤄보지 않고 한달안에 인수인계(...) 를 마쳐야 하는 이유로
평소 잘 접하던 python을 쓰고자 django를 선택했습니다.

선택한 RESTful 프레임웤은 django-piston 입니다. http://bitbucket.org/jespern/django-piston/wiki/Home

답변 주신 dragonkun, brucewang님, 감사합니다


Do you hear the people sing?

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.