Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
Y
yii2
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • PSDI Army
  • yii2
  • Repository

Switch branch/tag
  • yii2
  • extensions
  • authclient
  • BaseOAuth.php
Find file
BlameHistoryPermalink
  • Yuan Chong's avatar
    OAuth API Response with 20x status should be in normal · baee44c9
    Yuan Chong authored 10 years ago
    Hello,
    
    I used **Yii2 authclient** to build a Github OAuth (2.0) client, and performed a POST call to create a Github repository hook. But I got this exception:
    
    ```
    exception 'yii\authclient\InvalidResponseException' with message '
    Request failed with code: 201, message:
    {
    	"url": "https://api.github.com/repos/ychongsaytc/example/hooks/1000000",
    	"test_url": "https://api.github.com/repos/ychongsaytc/example/hooks/1000000/test",
    	"id": 1000000,
    	"name": "web",
    	"active": true,
    	"events": ["push"],
    	"config": {
    		"url": "https://example.com/payload",
    		"content_type": "form",
    		"secret": null
    	},
    	"last_response": {
    		"code": null,
    		"status": "unused",
    		"message": null
    	},
    	"updated_at": "2014-09-14T03:02:55Z",
    	"created_at": "2014-09-14T03:02:55Z"
    }
    ' in /home/ubuntu/public_html/live/vendor/yiisoft/yii2-authclient/BaseOAuth.php:206
    ```
    
    I think a successful API call is not always exactly return **200** status, like **Create a hook** API of Github: https://developer.github.com/v3/repos/hooks/
    
    It will return `201 Created` if hook was successfully created.
    
    In my opinion, is status code starts with **20** in normal scenario?
    
    close #5011
    baee44c9
BaseOAuth.php 16.4 KB
EditWeb IDE
×

Replace BaseOAuth.php

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.