mirror of
https://github.com/dyrkin/luxmed-bot.git
synced 2026-01-04 12:05:05 +01:00
Fixed user agent and slight refactoring
This commit is contained in:
@@ -2,7 +2,11 @@
|
||||
package com.lbs.api
|
||||
|
||||
import com.lbs.api.http.headers._
|
||||
import scalaj.http.{Http, HttpRequest}
|
||||
import scalaj.http.{BaseHttp, HttpRequest}
|
||||
|
||||
object ApiHttp extends BaseHttp(
|
||||
userAgent = "PatientPortal/3.10.0 (pl.luxmed.pp.LUX-MED; build:401; iOS 12.1.0) Alamofire/4.5.1"
|
||||
)
|
||||
|
||||
trait ApiBase {
|
||||
private val CommonHeaders =
|
||||
@@ -11,12 +15,11 @@ trait ApiBase {
|
||||
Accept -> "*/*",
|
||||
Connection -> "keep-alive",
|
||||
`Accept-Encoding` -> "gzip;q=1.0, compress;q=0.5",
|
||||
`User-Agent` -> "PatientPortal/3.10.0 (pl.luxmed.pp.LUX-MED; build:401; iOS 12.1.0) Alamofire/4.5.1",
|
||||
`Accept-Language` -> "en-PL;q=1.0, ru-PL;q=0.9, pl-PL;q=0.8, uk-PL;q=0.7"
|
||||
)
|
||||
|
||||
|
||||
protected def http(url: String): HttpRequest = {
|
||||
Http(s"https://portalpacjenta.luxmed.pl/PatientPortalMobileAPI/api/$url").headers(CommonHeaders)
|
||||
ApiHttp(s"https://portalpacjenta.luxmed.pl/PatientPortalMobileAPI/api/$url").headers(CommonHeaders)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user