Запросы Python: руководство

–ö–æ–≥–¥–∞ –≤—ã —Å–æ–∑–¥–∞–µ—Ç–µ –ø—Ä–∏–ª–æ–∂–µ–Ω–∏–µ –Ω–∞ Python, –º–æ–∂–µ—Ç –Ω–∞—Å—Ç—É–ø–∏—Ç—å –º–æ–º–µ–Ω—Ç, –∫–æ–≥–¥–∞ –≤—ã –∑–∞—Ö–æ—Ç–∏—Ç–µ –ø–æ–¥–∫–ª—é—á–∏—Ç—å—Å—è –∫ —Å—Ç–æ—Ä–æ–Ω–Ω–µ–π —Å–ª—É–∂–±–µ. –ù–∞–ø—Ä–∏–º–µ—Ä, –µ—Å–ª–∏ –≤—ã —Å–æ–∑–¥–∞–µ—Ç–µ —Ñ–∏—Ç–Ω–µ—Å-–∏–Ω—Å—Ç—Ä—É–º–µ–Ω—Ç, –≤—ã –º–æ–∂–µ—Ç–µ –ø–æ–¥–∫–ª—é—á–∏—Ç—å—Å—è –∫ Fitbit API, —á—Ç–æ–±—ã –≤–∏–¥–µ—Ç—å –¥–∞–Ω–Ω—ã–µ –æ —Å–≤–æ–∏—Ö —É–ø—Ä–∞–∂–Ω–µ–Ω–∏—è—Ö; –ø—Ä–∏–ª–æ–∂–µ–Ω–∏–µ, –∫–æ—Ç–æ—Ä–æ–µ –º–æ–∂–µ—Ç –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å —Ç–µ–∫—Å—Ç–æ–≤—ã–µ —Å–æ–æ–±—â–µ–Ω–∏—è, –º–æ–∂–µ—Ç –ø–æ–¥–∫–ª—é—á–∞—Ç—å—Å—è –∫ Twilio API.

–í Python –±–∏–±–ª–∏–æ—Ç–µ–∫–∞ –∑–∞–ø—Ä–æ—Å–æ–≤ –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º –¥–µ–ª–∞—Ç—å –∑–∞–ø—Ä–æ—Å—ã, —á—Ç–æ–±—ã –≤—ã –º–æ–≥–ª–∏ –ø–æ–¥–∫–ª—é—á–∞—Ç—å —Å—Ç–æ—Ä–æ–Ω–Ω–∏–µ –≤–µ–±-—Å–µ—Ä–≤–∏—Å—ã –∫ —Å–≤–æ–∏–º –ø—Ä–∏–ª–æ–∂–µ–Ω–∏—è–º. –í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è —É–∑–Ω–∞—Ç—å –æ –±–∏–±–ª–∏–æ—Ç–µ–∫–µ –∑–∞–ø—Ä–æ—Å–æ–≤ Python –∏ –æ —Ç–æ–º, –∫–∞–∫ –≤—ã –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –µ–µ –¥–ª—è –æ—Ç–ø—Ä–∞–≤–∫–∏ HTTP-–∑–∞–ø—Ä–æ—Å–æ–≤.

–í–µ–±-–∑–∞–ø—Ä–æ—Å—ã: –Ω–∞–ø–æ–º–∏–Ω–∞–Ω–∏–µ

–ó–∞–ø—Ä–æ—Å—ã –Ω–∞—Ö–æ–¥—è—Ç—Å—è –≤ —Ü–µ–Ω—Ç—Ä–µ –≤–Ω–∏–º–∞–Ω–∏—è –ò–Ω—Ç–µ—Ä–Ω–µ—Ç–∞. –ö–æ–≥–¥–∞ –≤—ã —â–µ–ª–∫–Ω—É–ª–∏ –ø–æ —ç—Ç–æ–π —Å—Ç–∞—Ç—å–µ, –Ω–∞ —Å–µ—Ä–≤–µ—Ä Python.Engineering –±—ã–ª –æ—Ç–ø—Ä–∞–≤–ª–µ–Ω HTTP-–∑–∞–ø—Ä–æ—Å. –≠—Ç–æ—Ç –∑–∞–ø—Ä–æ—Å —Å–æ–æ–±—â–∏–ª –Ω–∞—à–∏–º —Å–µ—Ä–≤–µ—Ä–∞–º, –∫–∞–∫—É—é –≤–µ–±-—Å—Ç—Ä–∞–Ω–∏—Ü—É –≤—ã —Ö–æ—Ç–∏—Ç–µ –≤–∏–¥–µ—Ç—å, —á—Ç–æ–±—ã –Ω–∞—à —Å–µ—Ä–≤–µ—Ä –º–æ–≥ –µ–µ –Ω–∞–π—Ç–∏. –ö–∞–∫ —Ç–æ–ª—å–∫–æ –≤–µ–±-—Å—Ç—Ä–∞–Ω–∏—Ü–∞ –±—ã–ª–∞ –Ω–∞–π–¥–µ–Ω–∞, –Ω–∞—à –≤–µ–±-—Å–µ—Ä–≤–µ—Ä –≤–µ—Ä–Ω—É–ª –µ–µ –≤–∞—à–µ–º—É –±—Ä–∞—É–∑–µ—Ä—É. –≠—Ç–æ—Ç –ø—Ä–æ—Ü–µ—Å—Å –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º —É–≤–∏–¥–µ—Ç—å —ç—Ç–æ —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–æ.

–í–µ–±-–∑–∞–ø—Ä–æ—Å—ã –±—ã–≤–∞—é—Ç —Ä–∞–∑–Ω—ã—Ö —Ñ–æ—Ä–º. –¢–∏–ø –∑–∞–ø—Ä–æ—Å–∞, –∫–æ—Ç–æ—Ä—ã–π –≤—ã —Å–¥–µ–ª–∞–ª–∏ –¥–ª—è –ø—Ä–æ—Å–º–æ—Ç—Ä–∞ —ç—Ç–æ–π –≤–µ–±-—Å—Ç—Ä–∞–Ω–∏—Ü—ã, –Ω–∞–∑—ã–≤–∞–ª—Å—è GET-–∑–∞–ø—Ä–æ—Å–æ–º. –≠—Ç–æ—Ç —Ç–∏–ø –∑–∞–ø—Ä–æ—Å–∞ –ø–æ–∑–≤–æ–ª—è–µ—Ç –ø–æ–ª—É—á–∞—Ç—å –¥–∞–Ω–Ω—ã–µ. –°—É—â–µ—Å—Ç–≤—É—é—Ç –∏ –¥—Ä—É–≥–∏–µ —Ç–∏–ø—ã –∑–∞–ø—Ä–æ—Å–æ–≤, —Ç–∞–∫–∏–µ –∫–∞–∫ POST –∏ PUT, –∫–æ—Ç–æ—Ä—ã–µ –∏—Å–ø–æ–ª—å–∑—É—é—Ç—Å—è –¥–ª—è –∏–∑–º–µ–Ω–µ–Ω–∏—è —Ä–µ—Å—É—Ä—Å–æ–≤ –Ω–∞ —Å–µ—Ä–≤–µ—Ä–µ. –í —Ä–∞–º–∫–∞—Ö —ç—Ç–æ–≥–æ —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–∞ –º—ã —Å–æ—Å—Ä–µ–¥–æ—Ç–æ—á–∏–º—Å—è –Ω–∞ –∑–∞–ø—Ä–æ—Å–∞—Ö GET –∏ POST.

–ö–∞–∫ —É—Å—Ç–∞–Ω–æ–≤–∏—Ç—å –∑–∞–ø—Ä–æ—Å—ã

–ó–∞–ø—Ä–æ—Å—ã - —ç—Ç–æ HTTP-–±–∏–±–ª–∏–æ—Ç–µ–∫–∞ –¥–ª—è Python, –∫–æ—Ç–æ—Ä–∞—è –ø–æ–∑–≤–æ–ª—è–µ—Ç —Å–æ–∑–¥–∞–≤–∞—Ç—å –≤–µ–±-–∑–∞–ø—Ä–æ—Å—ã. –∑–∞–ø—Ä–æ—Å—ã.

–ü—Ä–µ–∂–¥–µ —á–µ–º –º—ã —Å–º–æ–∂–µ–º –¥–µ–ª–∞—Ç—å –≤–µ–±-–∑–∞–ø—Ä–æ—Å—ã —Å –ø–æ–º–æ—â—å—é Python, –º—ã –¥–æ–ª–∂–Ω—ã —É—Å—Ç–∞–Ω–æ–≤–∏—Ç—å –±–∏–±–ª–∏–æ—Ç–µ–∫—É –∫–æ–¥–∞ –∑–∞–ø—Ä–æ—Å–æ–≤ Python. –ú—ã –º–æ–∂–µ–º —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ —Å –ø–æ–º–æ—â—å—é —Å–ª–µ–¥—É—é—â–µ–π –∫–æ–º–∞–Ω–¥—ã:

–¢–µ–ø–µ—Ä—å, –∫–æ–≥–¥–∞ –º—ã –∑–∞–≥—Ä—É–∑–∏–ª–∏ –ø–∞–∫–µ—Ç Python, –º—ã –≥–æ—Ç–æ–≤—ã —Å–¥–µ–ª–∞—Ç—å –≤–µ–±-–∑–∞–ø—Ä–æ—Å.

–ö–∞–∫ —Å–¥–µ–ª–∞—Ç—å GET-–∑–∞–ø—Ä–æ—Å

–°–∞–º—ã–π —Ä–∞—Å–ø—Ä–æ—Å—Ç—Ä–∞–Ω–µ–Ω–Ω—ã–π —Ç–∏–ø –≤–µ–±-–∑–∞–ø—Ä–æ—Å–∞, –∫–æ—Ç–æ—Ä—ã–π –≤—ã " ll make - —ç—Ç–æ –∑–∞–ø—Ä–æ—Å GET. –≠—Ç–æ—Ç —Ç–∏–ø –∑–∞–ø—Ä–æ—Å–∞ –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º –ø–æ–ª—É—á–∞—Ç—å –¥–∞–Ω–Ω—ã–µ —Å —Å–µ—Ä–≤–µ—Ä–∞.

81% —É—á–∞—Å—Ç–Ω–∏–∫–æ–≤ –∑–∞—è–≤–∏–ª–∏, —á—Ç–æ –æ–Ω–∏ –ø–æ—á—É–≤—Å—Ç–≤–æ–≤–∞–ª–∏ —Å–µ–±—è –±–æ–ª–µ–µ —É–≤–µ—Ä–µ–Ω–Ω—ã–º–∏ –≤ —Å–≤–æ–∏—Ö –ø–µ—Ä—Å–ø–µ–∫—Ç–∏–≤–∞—Ö —Ç—Ä—É–¥–æ—É—Å—Ç—Ä–æ–π—Å—Ç–≤–∞ –≤ —Å—Ñ–µ—Ä–µ –≤—ã—Å–æ–∫–∏—Ö —Ç–µ—Ö–Ω–æ–ª–æ–≥–∏–π –ø–æ—Å–ª–µ –ø–æ—Å–µ—â–µ–Ω–∏—è —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è. –ü–æ–ª—É—á–∏—Ç–µ –ø—Ä–∏–≥–ª–∞—à–µ–Ω–∏–µ –Ω–∞ —É—á–µ–±–Ω—ã–π –∫—É—Ä—Å —Å–µ–≥–æ–¥–Ω—è.

–°—Ä–µ–¥–Ω–∏–π –≤—ã–ø—É—Å–∫–Ω–∏–∫ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –ø—Ä–æ–≤–µ–ª –º–µ–Ω–µ–µ —à–µ—Å—Ç–∏ –º–µ—Å—è—Ü–µ–≤ –≤ –ø–µ—Ä–µ—Ö–æ–¥–µ –ø–æ –∫–∞—Ä—å–µ—Ä–Ω–æ–π –ª–µ—Å—Ç–Ω–∏—Ü–µ, –æ—Ç –Ω–∞—á–∞–ª–∞ —É—á–µ–±–Ω–æ–≥–æ –ª–∞–≥–µ—Ä—è –¥–æ –ø–æ–∏—Å–∫–∞ —Å–≤–æ–µ–π –ø–µ—Ä–≤–æ–π —Ä–∞–±–æ—Ç—ã.

–î–æ–ø—É—Å—Ç–∏–º, –º—ã —Å–æ–≥–ª–∞—Å–Ω—ã. —Å–æ–∑–¥–∞–Ω–∏–µ –ø—Ä–∏–ª–æ–∂–µ–Ω–∏—è, –∫–æ—Ç–æ—Ä–æ–µ –ø–æ–∑–≤–æ–ª—è–µ—Ç –ø–æ–ª—É—á–∏—Ç—å —Å–ø–∏—Å–æ–∫ —Ñ–∞–∫—Ç–æ–≤ –æ –∫–æ—à–∫–∞—Ö. –î–ª—è —ç—Ç–æ–≥–æ –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å API –ø–æ–¥ –Ω–∞–∑–≤–∞–Ω–∏–µ–º cat-fact. –≠—Ç–æ—Ç API –æ—Ç–∫—Ä—ã—Ç –¥–ª—è –≤—Å–µ—Ö, –ø–æ—ç—Ç–æ–º—É –Ω–∞–º –Ω–µ –Ω—É–∂–Ω—ã –Ω–∏–∫–∞–∫–∏–µ —É—á–µ—Ç–Ω—ã–µ –¥–∞–Ω–Ω—ã–µ –¥–ª—è –≤—Ö–æ–¥–∞. –ú—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —ç—Ç–æ—Ç –∫–æ–¥ –¥–ª—è –æ—Ç–ø—Ä–∞–≤–∫–∏ –∑–∞–ø—Ä–æ—Å–∞ –∫ API:

< p> –≠—Ç–æ—Ç –∫–æ–¥ –≤–µ—Ä–Ω—É–ª: 200. –î–∞–≤–∞–π—Ç–µ —Ä–∞–∑–±–µ—Ä–µ–º –Ω–∞—à –∫–æ–¥.

–í –ø–µ—Ä–≤–æ–π —Å—Ç—Ä–æ–∫–µ –º—ã –∏–º–ø–æ—Ä—Ç–∏—Ä–æ–≤–∞–ª–∏ –±–∏–±–ª–∏–æ—Ç–µ–∫—É –∑–∞–ø—Ä–æ—Å–æ–≤. –≠—Ç–æ –ø–æ–∑–≤–æ–ª–∏–ª–æ –Ω–∞–º –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø –∫ –±–∏–±–ª–∏–æ—Ç–µ–∫–µ –∑–∞–ø—Ä–æ—Å–æ–≤, –∫–æ—Ç–æ—Ä—É—é –º—ã –±—É–¥–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –≤ –Ω–∞—à–µ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ. –ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∏ –º–µ—Ç–æ–¥ requests.get () –¥–ª—è —Å–æ–∑–¥–∞–Ω–∏—è –≤–µ–±-–∑–∞–ø—Ä–æ—Å–∞. –ú—ã –º–æ–≥–ª–∏ –±—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å —Ç–∞–∫–∏–µ –º–µ—Ç–æ–¥—ã, –∫–∞–∫ .put () –∏–ª–∏ .post () –¥–ª—è –≤—ã–ø–æ–ª–Ω–µ–Ω–∏—è –¥—Ä—É–≥–∏—Ö —Ç–∏–ø–æ–≤ –∑–∞–ø—Ä–æ—Å–æ–≤, –Ω–æ –≤ —ç—Ç–æ–º —Å–ª—É—á–∞–µ –Ω–∞–º –Ω—É–∂–Ω–æ –±—ã–ª–æ —Ç–æ–ª—å–∫–æ –ø–æ–ª—É—á–∏—Ç—å –¥–∞–Ω–Ω—ã–µ –∏–∑ cat- API —Ñ–∞–∫—Ç–æ–≤.

–ó–∞—Ç–µ–º –º—ã —Ä–∞—Å–ø–µ—á–∞—Ç–∞–ª–∏ –∫–æ–¥ —Å–æ—Å—Ç–æ—è–Ω–∏—è –∏–∑ –Ω–∞—à–µ–≥–æ –≤–µ–±-–∑–∞–ø—Ä–æ—Å–∞. –ë—ã–ª–æ –≤–æ–∑–≤—Ä–∞—â–µ–Ω–æ —á–∏—Å–ª–æ 200, –æ–∑–Ω–∞—á–∞—é—â–µ–µ, —á—Ç–æ –Ω–∞—à –≤–µ–±-–∑–∞–ø—Ä–æ—Å –±—ã–ª —É—Å–ø–µ—à–Ω–æ –≤—ã–ø–æ–ª–Ω–µ–Ω. –ú—ã –æ–±—Å—É–¥–∏–º, —á—Ç–æ –æ–∑–Ω–∞—á–∞—é—Ç —ç—Ç–∏ —á–∏—Å–ª–∞, –ø–æ–∑–∂–µ –≤ —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ.

–ü—Ä–æ—Å–º–æ—Ç—Ä –∑–∞–ø—Ä–æ—Å–∞

–í –Ω–∞—à–µ–º –ø—Ä–∏–º–µ—Ä–µ –≤—ã—à–µ –º—ã —Ä–∞—Å–ø–µ—á–∞—Ç–∞–ª–∏ –∫–æ–¥ —Å–æ—Å—Ç–æ—è–Ω–∏—è –Ω–∞—à–µ–≥–æ –∑–∞–ø—Ä–æ—Å–∞. –ù–æ –∫–∞–∫ –º—ã –º–æ–∂–µ–º —É–≤–∏–¥–µ—Ç—å –ø–æ–ª—É—á–µ–Ω–Ω—ã–µ –¥–∞–Ω–Ω—ã–µ? –ì–¥–µ —Ñ–∞–∫—Ç—ã –æ –∫–æ—à–∫–∞—Ö? –í–æ—Ç –≥–¥–µ –ø—Ä–∏–≥–æ–¥—è—Ç—Å—è –º–µ—Ç–æ–¥—ã .text –∏ .json ().

–ü—Ä–æ—Å–º–æ—Ç—Ä —Ç–µ–∫—Å—Ç–æ–≤–æ–≥–æ –æ—Ç–≤–µ—Ç–∞

–ú—ã –º–æ–∂–µ–º –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –º–µ—Ç–æ–¥ .text, —á—Ç–æ–±—ã —É–≤–∏–¥–µ—Ç—å —Ä–µ–∑—É–ª—å—Ç–∞—Ç –Ω–∞—à–µ–≥–æ –≤–µ–±-–∑–∞–ø—Ä–æ—Å–∞:

–≠—Ç–æ—Ç –∫–æ–¥ –≤–µ—Ä–Ω—É–ª —Å–ø–∏—Å–æ–∫ —Ñ–∞–∫—Ç–æ–≤ –æ –∫–æ—à–∫–∞—Ö. –ù–æ —ç—Ç–æ –Ω–µ –æ—á–µ–Ω—å –ø—Ä–∞–∫—Ç–∏—á–Ω–æ –¥–ª—è –Ω–∞—Å, –ø–æ—Ç–æ–º—É —á—Ç–æ –¥–∞–Ω–Ω—ã–µ, –∫–æ—Ç–æ—Ä—ã–µ –º—ã –∑–∞–ø—Ä–∞—à–∏–≤–∞–µ–º, —è–≤–ª—è—é—Ç—Å—è API. –•–æ—Ç—è —Ç–µ–ø–µ—Ä—å —É –Ω–∞—Å –µ—Å—Ç—å —Å–ø–∏—Å–æ–∫ Python —Ñ–∞–∫—Ç–æ–≤ –æ –∫–æ—à–∫–∞—Ö, –Ω–∞–º —Ç—Ä—É–¥–Ω–æ –∏—Ö —á–∏—Ç–∞—Ç—å, –ø–æ—Ç–æ–º—É —á—Ç–æ –æ–Ω–∏ –ø—Ä–µ–¥—Å—Ç–∞–≤–ª–µ–Ω—ã –≤ –≤–∏–¥–µ –æ–±—ã—á–Ω–æ–≥–æ —Ç–µ–∫—Å—Ç–∞.

–ë–æ–ª–µ–µ –ø–æ–ª–µ–∑–Ω—ã–º —Ñ–æ—Ä–º–∞—Ç–æ–º, –≤ –∫–æ—Ç–æ—Ä–æ–º –º–æ–≥—É—Ç —Ö—Ä–∞–Ω–∏—Ç—å—Å—è –Ω–∞—à–∏ —Ñ–∞–∫—Ç—ã –æ –∫–æ—à–∫–∞—Ö, —è–≤–ª—è–µ—Ç—Å—è JSON. –ú—ã –º–æ–≥–ª–∏ –ø–æ–ª—É—á–∏—Ç—å –¥–∞–Ω–Ω—ã–µ JSON –∏–∑ –Ω–∞—à–µ–≥–æ –∑–∞–ø—Ä–æ—Å–∞, –∏—Å–ø–æ–ª—å–∑—É—è —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥:

–ù–∞—à –∫–æ–¥ –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç –¥–ª–∏–Ω–Ω—ã–π —Å–ø–∏—Å–æ–∫ —Ñ–∞–∫—Ç–æ–≤ –æ –∫–æ—à–∫–∞—Ö. –í–æ—Ç –ø–µ—Ä–≤–∞—è –∑–∞–ø–∏—Å—å –≤ —Å–ø–∏—Å–∫–µ:

–£—Å–ø–µ—Ö! –ù–∞–º —É–¥–∞–ª–æ—Å—å –ø–æ–ª—É—á–∏—Ç—å –Ω–∞—à —Å–ø–∏—Å–æ–∫ —Ñ–∞–∫—Ç–æ–≤ –æ –∫–æ—à–∫–∞—Ö.

–ö–∞–∫ —Å–¥–µ–ª–∞—Ç—å –∑–∞–ø—Ä–æ—Å POST

–í—ã —Ç–∞–∫–∂–µ –º–æ–∂–µ—Ç–µ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –±–∏–±–ª–∏–æ—Ç–µ–∫—É –∑–∞–ø—Ä–æ—Å–æ–≤ –¥–ª—è –≤—ã–ø–æ–ª–Ω–µ–Ω–∏—è –∑–∞–ø—Ä–æ—Å–∞ POST. –≠—Ç–æ –ø–æ–∑–≤–æ–ª–∏—Ç –≤–∞–º –∏–∑–º–µ–Ω—è—Ç—å –¥–∞–Ω–Ω—ã–µ, —Ö—Ä–∞–Ω—è—â–∏–µ—Å—è –Ω–∞ –≤–µ–±-—Å–µ—Ä–≤–µ—Ä–µ.

–í —ç—Ç–æ–º –ø—Ä–∏–º–µ—Ä–µ –º—ã —Å–æ–±–∏—Ä–∞–µ–º—Å—è –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å Airtable API. –≠—Ç–æ —Å–≤—è–∑–∞–Ω–æ —Å —Ç–µ–º, —á—Ç–æ –Ω–∞–º –Ω—É–∂–Ω–æ –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å API, –ø–æ–¥–¥–µ—Ä–∂–∏–≤–∞—é—â–∏–π –∑–∞–ø—Ä–æ—Å—ã POST, –∞ API cat-fact –¥–æ—Å—Ç—É–ø–µ–Ω —Ç–æ–ª—å–∫–æ –¥–ª—è —á—Ç–µ–Ω–∏—è.

< p> –ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, —É –Ω–∞—Å –µ—Å—Ç—å –±–∞–∑–∞ –¥–∞–Ω–Ω—ã—Ö, –≤ –∫–æ—Ç–æ—Ä–æ–π –º—ã –∑–∞–ø–∏—Å—ã–≤–∞–µ–º –≤—Å–µ —á–∞—à–∫–∏ —á–∞—è, –∫–æ—Ç–æ—Ä—ã–µ –º—ã –≤—ã–ø–∏–≤–∞–µ–º. –ú—ã —Ç–æ–ª—å–∫–æ —á—Ç–æ –≤—ã–ø–∏–ª–∏ –µ—â–µ –æ–¥–Ω—É —á–∞—à–∫—É —á–∞—è –∏ —Ö–æ—Ç–∏–º –¥–æ–±–∞–≤–∏—Ç—å –µ–µ –≤ –±–∞–∑—É –¥–∞–Ω–Ω—ã—Ö. –ú—ã –º–æ–∂–µ–º —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ —Å –ø–æ–º–æ—â—å—é —Å–ª–µ–¥—É—é—â–µ–≥–æ –∫–æ–¥–∞:

–ù–∞—à –∫–æ–¥ –≤–µ—Ä–Ω—É–ª:

–≠—Ç–æ –≥–æ–≤–æ—Ä–∏—Ç –Ω–∞–º, —á—Ç–æ –Ω–∞—à HTTP-–∑–∞–ø—Ä–æ—Å –±—ã–ª —É—Å–ø–µ—à–Ω—ã–º. –ú—ã —Ç–æ–ª—å–∫–æ —á—Ç–æ –¥–æ–±–∞–≤–∏–ª–∏ –∑–∞–ø–∏—Å—å –≤ –Ω–∞—à—É –±–∞–∑—É –¥–∞–Ω–Ω—ã—Ö Airtable, –∏—Å–ø–æ–ª—å–∑—É—è –∏—Ö API. –î–∞–≤–∞–π—Ç–µ –æ–±—Å—É–¥–∏–º —ç—Ç–∏ —Å—Ç—Ä–æ–∫–∏ –∫–æ–¥–∞ –¥–∞–ª—å—à–µ.

–°–Ω–∞—á–∞–ª–∞ –º—ã –∏–º–ø–æ—Ä—Ç–∏—Ä–æ–≤–∞–ª–∏ –±–∏–±–ª–∏–æ—Ç–µ–∫—É –∑–∞–ø—Ä–æ—Å–æ–≤, —á—Ç–æ–±—ã –º—ã –º–æ–≥–ª–∏ –¥–µ–ª–∞—Ç—å HTTP-–∑–∞–ø—Ä–æ—Å—ã –≤ –Ω–∞—à–µ–º –∫–æ–¥–µ.

–ó–∞—Ç–µ–º –º—ã –æ–ø—Ä–µ–¥–µ–ª–∏–ª–∏ —Å–ª–æ–≤–∞—Ä—å, —Å–æ–¥–µ—Ä–∂–∞—â–∏–π –¥–≤–∞ –∫–ª—é—á–∞ –∏ –∑–Ω–∞—á–µ–Ω–∏—è: –æ–¥–∏–Ω —Ö—Ä–∞–Ω–∏—Ç –Ω–∞—à –∫–ª—é—á –∞—É—Ç–µ–Ω—Ç–∏—Ñ–∏–∫–∞—Ü–∏–∏, –∞ –¥—Ä—É–≥–æ–π –æ–ø—Ä–µ–¥–µ–ª—è–µ—Ç —Ç–∏–ø –∫–æ–Ω—Ç–µ–Ω—Ç–∞, –∫–æ—Ç–æ—Ä—ã–π –º—ã –æ—Ç–ø—Ä–∞–≤–ª—è–µ–º –Ω–∞ –≤–µ–±-—Å–µ—Ä–≤–µ—Ä. –≠—Ç–æ –∑–∞–≥–æ–ª–æ–≤–∫–∏, –∫–æ—Ç–æ—Ä—ã–µ –Ω–∞–º –Ω—É–∂–Ω–æ –±—ã–ª–æ –æ—Ç–ø—Ä–∞–≤–∏—Ç—å, —á—Ç–æ–±—ã —Å–¥–µ–ª–∞—Ç—å –∑–∞–ø—Ä–æ—Å –∫ Airtable API.

–ó–∞—Ç–µ–º –º—ã –æ–±—ä—è–≤–∏–ª–∏ –ø–µ—Ä–µ–º–µ–Ω–Ω—É—é —Å –∏–º–µ–Ω–µ–º data, –≤ –∫–æ—Ç–æ—Ä–æ–π —Ö—Ä–∞–Ω—è—Ç—Å—è –¥–∞–Ω–Ω—ã–µ, –∫–æ—Ç–æ—Ä—ã–µ –º—ã —Ö–æ—Ç–µ–ª–∏ –æ—Ç–ø—Ä–∞–≤–∏—Ç—å –≤–º–µ—Å—Ç–µ —Å –Ω–∞—à–∏–º –∑–∞–ø—Ä–æ—Å–æ–º POST. –í –¥–∞–Ω–Ω–æ–º —Å–ª—É—á–∞–µ –º—ã –¥–æ–±–∞–≤–ª—è–ª–∏ –Ω–∞–ø–∏—Ç–æ–∫ –ø–æ–¥ –Ω–∞–∑–≤–∞–Ω–∏–µ–º "–ß–µ—Ä–Ω—ã–π —á–∞–π –±–µ–∑ –∫–æ—Ñ–µ–∏–Ω–∞". –≤ –Ω–∞—à—É –±–∞–∑—É –¥–∞–Ω–Ω—ã—Ö. –ó–∞—Ç–µ–º –º—ã –∏—Å–ø–æ–ª—å–∑–æ–≤–∞–ª–∏ –º–µ—Ç–æ–¥ requests.post () –∏ —É–∫–∞–∑–∞–ª–∏ –Ω–∞—à–∏ –∑–∞–≥–æ–ª–æ–≤–∫–∏ –∏ –¥–∞–Ω–Ω—ã–µ –≤ –∫–∞—á–µ—Å—Ç–≤–µ –ø–∞—Ä–∞–º–µ—Ç—Ä–æ–≤, —á—Ç–æ –ø–æ–∑–≤–æ–ª–∏–ª–æ –Ω–∞–º —Å–¥–µ–ª–∞—Ç—å POST-–∑–∞–ø—Ä–æ—Å –∫ Airtable API.

" –ö–∞—Ä—å–µ—Ä–∞ –ö–∞—Ä–º–∞ –≤–æ—à–ª–∞ –≤ –º–æ—é –∂–∏–∑–Ω—å, –∫–æ–≥–¥–∞ —è –±–æ–ª—å—à–µ –≤—Å–µ–≥–æ –≤ –Ω–µ–π –Ω—É–∂–¥–∞–ª–∞—Å—å, –∏ –±—ã—Å—Ç—Ä–æ –ø–æ–º–æ–≥–ª–∞ –º–Ω–µ –ø—Ä–æ–π—Ç–∏ –∫—É—Ä—Å –æ–±—É—á–µ–Ω–∏—è. –ß–µ—Ä–µ–∑ –¥–≤–∞ –º–µ—Å—è—Ü–∞ –ø–æ—Å–ª–µ –≤—ã–ø—É—Å–∫–∞ —è –Ω–∞—à–ª–∞ —Ä–∞–±–æ—Ç—É —Å–≤–æ–µ–π –º–µ—á—Ç—ã, –∫–æ—Ç–æ—Ä–∞—è —Å–æ–æ—Ç–≤–µ—Ç—Å—Ç–≤–æ–≤–∞–ª–∞ –º–æ–∏–º —Ü–µ–Ω–Ω–æ—Å—Ç—è–º –∏ —Ü–µ–ª—è–º –≤ –∂–∏–∑–Ω–∏! "

–í–µ–Ω–µ—Ä–∞, –∏–Ω–∂–µ–Ω–µ—Ä-–ø—Ä–æ–≥—Ä–∞–º–º–∏—Å—Ç Rockbot

–ù–∞–∫–æ–Ω–µ—Ü, –º—ã —Ä–∞—Å–ø–µ—á–∞—Ç–∞–ª–∏ —Ä–µ–∑—É–ª—å—Ç–∞—Ç –Ω–∞—à–µ–≥–æ –∑–∞–ø—Ä–æ—Å–∞ –≤ —Ñ–æ—Ä–º–∞—Ç–µ JSON —Å –ø–æ–º–æ—â—å—é res.json (). < / p>

–ö–æ–¥—ã —Å–æ—Å—Ç–æ—è–Ω–∏—è HTTP

–ü—Ä–æ—Ç–æ–∫–æ–ª HTTP –≤–æ–∑–≤—Ä–∞—â–∞–µ—Ç —É–Ω–∏–∫–∞–ª—å–Ω—ã–π –∫–æ–¥ —Å–æ—Å—Ç–æ—è–Ω–∏—è, –∫–æ–≥–¥–∞ –≤—ã –¥–µ–ª–∞–µ—Ç–µ –≤–µ–±-–∑–∞–ø—Ä–æ—Å. –≠—Ç–æ –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º —É–≤–∏–¥–µ—Ç—å, –±—ã–ª –ª–∏ –≤–∞—à –≤–µ–±-–∑–∞–ø—Ä–æ—Å —É—Å–ø–µ—à–Ω—ã–º –∏–ª–∏ –≤–æ–∑–Ω–∏–∫–ª–∏ –∫–∞–∫–∏–µ-–ª–∏–±–æ –æ—à–∏–±–∫–∏. –í—ã, –≤–µ—Ä–æ—è—Ç–Ω–æ, —É–∂–µ –≤–∏–¥–µ–ª–∏ –Ω–µ–∫–æ—Ç–æ—Ä—ã–µ –∏–∑ –Ω–∏—Ö, –Ω–∞–ø—Ä–∏–º–µ—Ä 404.

–í–æ—Ç —Å–ø—Ä–∞–≤–æ—á–Ω—ã–π —Å–ø–∏—Å–æ–∫ –∫–æ–¥–æ–≤ —Å–æ—Å—Ç–æ—è–Ω–∏—è, —Å –∫–æ—Ç–æ—Ä—ã–º–∏ –≤—ã –º–æ–∂–µ—Ç–µ —Å—Ç–æ–ª–∫–Ω—É—Ç—å—Å—è –ø—Ä–∏ –≤—ã–ø–æ–ª–Ω–µ–Ω–∏–∏ –∑–∞–ø—Ä–æ—Å–∞ —Å –ø–æ–º–æ—â—å—é –∑–∞–ø—Ä–æ—Å–æ–≤ Python:

  • 1XX: –∏–Ω—Ñ–æ—Ä–º–∞—Ü–∏—è
  • 2XX: –∑–∞–ø—Ä–æ—Å –≤—ã–ø–æ–ª–Ω–µ–Ω —É—Å–ø–µ—à–Ω–æ
  • 3XX: –∑–∞–ø—Ä–æ—Å –±—ã–ª –ø–µ—Ä–µ–Ω–∞–ø—Ä–∞–≤–ª–µ–Ω
  • 4XX: –æ—à–∏–±–∫–∞ –Ω–∞ —Å—Ç–æ—Ä–æ–Ω–µ –∫–ª–∏–µ–Ω—Ç–∞
  • 5XX: –æ—à–∏–±–∫–∞ –Ω–∞ —Å—Ç–æ—Ä–æ–Ω–µ —Å–µ—Ä–≤–µ—Ä–∞

–ó–Ω–∞–Ω–∏–µ —ç—Ç–∏—Ö –∫–æ–¥–æ–≤ —Å–æ—Å—Ç–æ—è–Ω–∏—è –ø–æ–∑–≤–æ–ª—è–µ—Ç –Ω–∞–º –¥–æ–±–∞–≤–ª—è—Ç—å –æ—Ç–ª–∞–¥–∫—É –≤ –Ω–∞—à—É –ø—Ä–æ–≥—Ä–∞–º–º—É. –î–∞–≤–∞–π—Ç–µ –≤–æ–∑—å–º–µ–º –∑–∞–ø—Ä–æ—Å GET –∏–∑ –ø—Ä–∏–º–µ—Ä–∞ API cat-fact, –ø—Ä–∏–≤–µ–¥–µ–Ω–Ω–æ–≥–æ —Ä–∞–Ω–µ–µ. –ü—Ä–µ–¥–ø–æ–ª–æ–∂–∏–º, –º—ã —Ö–æ—Ç–∏–º —Ä–∞—Å–ø–µ—á–∞—Ç–∞—Ç—å —Å–æ–æ–±—â–µ–Ω–∏–µ, –µ—Å–ª–∏ —Ä–µ—Å—É—Ä—Å, –∫ –∫–æ—Ç–æ—Ä–æ–º—É –º—ã –æ–±—Ä–∞—â–∞–µ–º—Å—è, –Ω–µ –º–æ–∂–µ—Ç –±—ã—Ç—å –Ω–∞–π–¥–µ–Ω. –ú—ã –º–æ–≥–ª–∏ –±—ã —Å–¥–µ–ª–∞—Ç—å —ç—Ç–æ, –∏—Å–ø–æ–ª—å–∑—É—è —Å–ª–µ–¥—É—é—â–∏–π –∫–æ–¥:

–ù–∞—à –∫–æ–¥ –≤–µ—Ä–Ω—É–ª: –£—Å–ø–µ—Ö. –ü–æ—Å–∫–æ–ª—å–∫—É –∫–æ–¥ —Å–æ—Å—Ç–æ—è–Ω–∏—è –Ω–∞—à–µ–≥–æ –∑–∞–ø—Ä–æ—Å–∞ - 200, —Å–æ–æ–±—â–µ–Ω–∏–µ "–£—Å–ø–µ—Ö" –≤—ã–≤–æ–¥–∏—Ç—Å—è –Ω–∞ –∫–æ–Ω—Å–æ–ª—å. –û–¥–Ω–∞–∫–æ, –µ—Å–ª–∏ –Ω–∞—à –∑–∞–ø—Ä–æ—Å –Ω–µ —É–¥–∞–ª—Å—è & ndash; –Ω–∞–ø—Ä–∏–º–µ—Ä, –º—ã –º–æ–≥–ª–∏ —É–∫–∞–∑–∞—Ç—å –Ω–µ–≤–µ—Ä–Ω—ã–π URL & ndash; –∑–∞—Ç–µ–º –ø–æ—è–≤–∏—Ç—Å—è —Å–æ–æ–±—â–µ–Ω–∏–µ " –û—à–∏–±–∫–∞ " –±—ã–ª–∏ –±—ã –Ω–∞–ø–µ—á–∞—Ç–∞–Ω—ã –Ω–∞ –∫–æ–Ω—Å–æ–ª–∏.

–ó–∞–∫–ª—é—á–µ–Ω–∏–µ

–ë–∏–±–ª–∏–æ—Ç–µ–∫–∞ –∑–∞–ø—Ä–æ—Å–æ–≤ Python –ø–æ–∑–≤–æ–ª—è–µ—Ç –≤–∞–º –¥–µ–ª–∞—Ç—å HTTP-–∑–∞–ø—Ä–æ—Å—ã –≤ Python. –í —ç—Ç–æ–º —Ä—É–∫–æ–≤–æ–¥—Å—Ç–≤–µ –º—ã –æ–±—Å—É–¥–∏–ª–∏, –∫–∞–∫ –±–∏–±–ª–∏–æ—Ç–µ–∫–∞ –∑–∞–ø—Ä–æ—Å–æ–≤ Python –∏—Å–ø–æ–ª—å–∑—É–µ—Ç—Å—è –¥–ª—è –≤—ã–ø–æ–ª–Ω–µ–Ω–∏—è –∑–∞–ø—Ä–æ—Å–æ–≤ GET –∏ POST, –Ω–æ –≤—ã —Ç–∞–∫–∂–µ –º–æ–∂–µ—Ç–µ –≤—ã–ø–æ–ª–Ω—è—Ç—å –∑–∞–ø—Ä–æ—Å—ã PUT –∏ DELETE —Å –ø–æ–º–æ—â—å—é –±–∏–±–ª–∏–æ—Ç–µ–∫–∏.

–ö–æ–≥–¥–∞ –≤—ã –∏—Å–ø–æ–ª—å–∑—É–µ—Ç–µ —Ç–∞–∫–æ–π –º–µ—Ç–æ–¥, –∫–∞–∫ requests.get () –∏–ª–∏ requests.post (), Python —Å–¥–µ–ª–∞–µ—Ç –∑–∞–ø—Ä–æ—Å –∫ –≤–µ–±-—Ä–µ—Å—É—Ä—Å—É, –∫ –∫–æ—Ç–æ—Ä–æ–º—É –≤—ã —Ö–æ—Ç–∏—Ç–µ –ø–æ–ª—É—á–∏—Ç—å –¥–æ—Å—Ç—É–ø. –í—ã –º–æ–∂–µ—Ç–µ –ø—Ä–∏–∫—Ä–µ–ø–ª—è—Ç—å –∑–∞–≥–æ–ª–æ–≤–∫–∏ –∏ –¥–∞–Ω–Ω—ã–µ –∫ —Å–≤–æ–µ–º—É –∑–∞–ø—Ä–æ—Å—É, —á—Ç–æ –ø–æ–∑–≤–æ–ª—è–µ—Ç –æ—Ç–ø—Ä–∞–≤–ª—è—Ç—å –∏–Ω—Ñ–æ—Ä–º–∞—Ü–∏—é, –µ—Å–ª–∏ –≤—ã —Ö–æ—Ç–∏—Ç–µ –≤–Ω–µ—Å—Ç–∏ –∏–∑–º–µ–Ω–µ–Ω–∏—è –≤ –≤–µ–±-—Ä–µ—Å—É—Ä—Å, –∫–æ—Ç–æ—Ä—ã–º –≤—ã –≤–ª–∞–¥–µ–µ—Ç–µ.

–¢–µ–ø–µ—Ä—å –≤—ã –≥–æ—Ç–æ–≤—ã –Ω–∞—á–∞—Ç—å –∏—Å–ø–æ–ª—å–∑–æ–≤–∞—Ç—å –∑–∞–ø—Ä–æ—Å—ã Python –±–∏–±–ª–∏–æ—Ç–µ–∫–∞ –∫–∞–∫ —ç–∫—Å–ø–µ—Ä—Ç!

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers

News


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method