Skip to content
#

API

An API can be thought of as an instruction manual for communication between multiple software apparatuses. For example, an API may be used for database communication between web applications. By extracting the implementation and relinquishing data into objects, an API simplifies programming.

Here are 28,691 public repositories matching this topic...

httpie
nhooey
nhooey commented Mar 6, 2020

It's not clear from the website's documentation, or the --help output, how to do the following equivalent curl task:

Post a raw JSON query to ElasticSearch:

curl \
    --header "Content-Type: application/json" \
    --request POST \
    --data '{ "_source": [ "restricted_countries.*" ], "query": { "match_all": {} }, "size": 1000 }' \
    'http://localhost:9200/_search'

T

habeeb555-q
habeeb555-q commented Jan 10, 2020
Request Method: GET
http://127.0.0.1:8000/api/
3.0.2
AssertionError
Using OpenAPIRenderer, but pyyaml is not installed.
/home/admin/DEV/PYTHON/Frameworks/django/HighEndSalesEnv/lib/python3.7/site-packages/rest_framework/renderers.py in init, line 1053
/home/admin/DEV/PYTHON/Frameworks/django/HighEndSalesEnv/bin/python
3.7.5
['/home/admin/DEV/PYTHON/Frameworks/django/HighE
ghostbody
ghostbody commented Aug 20, 2019

简介

通过 yapi 定义出接口其实是一件很 challenge 和重复的事情。

一般的我们的基于“资源”概念的 restful 接口会对某个数据模型(model)实现 CRUD 接口 (增删改查)。

假设我们一个基本的管理用户的需求。

  • 获取用户列表 GET /api/v1/users?_num=10&_page=1
  • 获取某个用户 GET /api/v1/users/:id
  • 新增一个用户 POST /api/v1/users
  • 删除某个用户 DELETE /api/v1/users/:id
  • 更新某个用户 PUT /api/v1/users/:id

对于 yapi,意味着我们需要至少定义 5个接口,这些接口的 request 和 response 存在很大需要复用数据模型的需求。

最近找到一个工具,可以结合起来定义相关模型。

yippibrian
yippibrian commented May 21, 2019

It looks like most of the advice from the OWASP REST Cheat Sheet is discussed in this API-Security-Checklist, but OWASP talks about the importance of CORS, which is not mentioned at all in this API-Security-Checklist. Probably good to make mention. Also, the OWASP REST Cheat Sheet provides a bit more guidance regarding validation that might be good to incorporate.

https://github.com/OWASP/Che

ccxt
xmatthias
xmatthias commented Feb 14, 2020

While ccxt does a great job unifying most functions / settings, not everything is or can be unified.
I think it would be good to provide a separate wiki/documentation page which documents exchange-specific properties.

The behavior is there now and all is working well - but to find it users need to search through issues (which are not easy to navigate) to find certain exchange-specifics - and o

fastapi
tiangolo
tiangolo commented Feb 9, 2020

Is your feature request related to a problem

Is your feature request related to a problem?

It's still not documented how to do redirections.

The solution you would like

We need a short section in the docs, in the Advanced User Guide, about how to do redirections.

It would have to explain how to use [Starlette's RedirectResponse](https://www.starlette.io/responses/#redirect

snaker00
snaker00 commented Dec 11, 2018

from wxpy import *
bot = Bot(cache_path=True) # 保持登陆状态
@bot.register()
def reply_friend(msg):
print('接收:' + str(msg)) #打印接收到的消息
msg.reply("hello world") #回复消息
msg.reply_image('12.png') #回复图片
msg.reply_file(‘12.png') #回复文件
msg.reply_file('1.txt') #回复文件
embed()
以上是一个例,期望运行结果是不管谁发送过来的消息都直接回复,但是第六行可以发送消息成功,第七行可以发送图片成功,第八行把图片已文件的形式发送也可以成功,但是第九行文件就是发送不了,发送1.zip也是发送不了

Timunas
Timunas commented Sep 10, 2019

Custom error formatter must have now 5 arguments instead of the old 4. These changes were introduced here on #1652

When migrating from 0.19 to 1.1.0 I had issues on a custom error formatter because the original_exception argument was introduced but that change was not documented on the upgrading guide.

web3.js
rajsite
rajsite commented Feb 11, 2020

I'm upgrading a build environment from python 2 to python 3 and noticed that endpoints with seeded random numbers are not returning the same values. It seems to be related to usage of randint:
https://github.com/postmanlabs/httpbin/blob/f8ec666b4d1b654e4ff6aedd356f510dcac09f83/httpbin/core.py#L1448

It seems like randint is not seed safe and it looks like only random() is: https://bugs.python.o

edlefebvre
edlefebvre commented Dec 10, 2019

Prerequisites

  • I am running the latest version. (up upgrade)
  • I searched to see if the issue already exists.
  • I inspected the verbose debug output with the -v, --verbose flag.
  • Are you an Up Pro subscriber?

Description

It would be great to add regex capabilities to redirects like so:

redirects: {
  "/folder/:slug(regexhere)": {
    "location": "https
yarin177
yarin177 commented Jan 11, 2020

Hey, I'm trying to fetch out the data with JSON I've spent way too much time on google and tried every single solution with no success.. when I send the request it raises an json.decoder.JSONDecodeError Exception.
maybe can you help?

class TextOcrRes:
    def on_post(self, req, resp):
        """Handles Text POST requests"""
        json_data = json.loads(req.bounded_stream.read().deco
Wikipedia
Wikipedia
You can’t perform that action at this time.