1

mailjet Python APIを使用していますが、少し混乱しています。

https://www.mailjet.com/docs/api/lists/contacts

このAPIクラスを使用してmailjetsのGETメソッドを呼び出すことさえ可能ではないようです。誰かがこれが事実であることを確認できますか?

api.lists.Contacts(id='foo') # causes POST, thus 405

これが彼らのAPIクラスです。クラスApiMethodFunctionにオプションを渡すことすら見ていません。connection

class ApiMethod(object):
    def __init__(self, api, method):
        self.api = api
        self.method = method

    def __getattr__(self, function):
        return ApiMethodFunction(self, function)

    def __unicode__(self):
        return self.method

class ApiMethodFunction(object):
    def __init__(self, method, function):
        self.method = method
        self.function = function

    def __call__(self, **kwargs):
        response = self.method.api.connection.open(
            self.method,
            self.function,
            postdata=kwargs,
        )
        return json.load(response)

    def __unicode__(self):
        return self.function

それは重要な機能のように思われるので、私はそれを間違って使用していると思う傾向がありますが、それは可能でしょうか?

idGETパラメータで必要な場合、連絡先をどのようにリストすることになっていますか?

4

1 に答える 1

1

Pythonライブラリが修正されました。その作成者によると、リクエストをPOSTにするかGETにするかを指定するパラメータを渡すことができるようになりました

https://github.com/WoLpH/mailjet

于 2012-09-08T07:50:23.650 に答える