Skip to content

Instantly share code, notes, and snippets.

@mninc
Created April 28, 2018 15:30
Show Gist options
  • Save mninc/be748bb290e4608ce4c8bbdf7f00249c to your computer and use it in GitHub Desktop.
Save mninc/be748bb290e4608ce4c8bbdf7f00249c to your computer and use it in GitHub Desktop.

Revisions

  1. mninc created this gist Apr 28, 2018.
    15 changes: 15 additions & 0 deletions test.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    import requests
    from time import sleep

    api_key = ""
    hats = ["Herald's Helm", "Brotherhood of Arms", "Hole Modest Pile of Hat"]

    print("Parameters in query string:")
    for item in hats:
    print(requests.get("https://backpack.tf/api/classifieds/search/v1", params={"key": api_key, "item": item}).json())

    sleep(5)

    print("Parameters in body:")
    for item in hats:
    print(requests.get("https://backpack.tf/api/classifieds/search/v1", data={"key": api_key, "item": item}).json())