mirror of https://github.com/MISP/PyMISP
Python 2/3 compatible, urllib module
parent
c73becee36
commit
9e8f81aafe
|
@ -8,11 +8,12 @@ import datetime
|
||||||
import os
|
import os
|
||||||
import base64
|
import base64
|
||||||
import re
|
import re
|
||||||
import urllib
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from urllib.parse import urljoin
|
from urllib.parse import urljoin
|
||||||
|
from urllib.parse import quote
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
from urllib import quote
|
||||||
from urlparse import urljoin
|
from urlparse import urljoin
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
import zipfile
|
import zipfile
|
||||||
|
@ -681,7 +682,7 @@ class PyMISP(object):
|
||||||
return self._check_response(response)
|
return self._check_response(response)
|
||||||
|
|
||||||
def search_index(self, value):
|
def search_index(self, value):
|
||||||
value = urllib.quote(value)
|
value = quote(value)
|
||||||
session = self.__prepare_session('json')
|
session = self.__prepare_session('json')
|
||||||
url = urljoin(self.root_url, 'events/index/searchall:%s' % value)
|
url = urljoin(self.root_url, 'events/index/searchall:%s' % value)
|
||||||
response = session.get(url)
|
response = session.get(url)
|
||||||
|
|
Loading…
Reference in New Issue