https://stackoverflow.com/questions/17301938/making-a-request-to-a-restful-api-using-python


import requests
url = 'http://ES_search_demo.com/document/record/_search?pretty=true'
data = '''{
  "query": {
    "bool": {
      "must": [
        {
          "text": {
            "record.document": "SOME_JOURNAL"
          }
        },
        {
          "text": {
            "record.articleTitle": "farmers"
          }
        }
      ],
      "must_not": [],
      "should": []
    }
  },
  "from": 0,
  "size": 50,
  "sort": [],
  "facets": {}
}'''
response = requests.post(url, data=data)



'Language > python' 카테고리의 다른 글

[python] ctypes API example  (0) 2017.12.13
[python] ctypes.memmove() example  (0) 2017.12.13
[python] random list with no duplicates  (0) 2017.12.08
[python] selenium install  (0) 2017.11.30
[python] list in for-loop syntax (+tuple)  (0) 2017.11.29

WRITTEN BY
hojongs
블로그 옮겼습니다 https://hojongs.github.io/