def register()

in migrator/src/main/scala/com/gu/pathmanager/PathManagerConnection.scala [11:22]


  def register(proposedPathRecord: PathRecord) = {
    val id = proposedPathRecord.identifier

    val body = RequestBody.create(JSON, proposedPathRecord.toJsonString)
    val req = new Request.Builder().url(pathManagerBaseUrl + s"paths/$id").put(body).build()
    val resp = httpclient.newCall(req).execute()

    if(!resp.isSuccessful) {
      val body = resp.body().string()
      throw new Exception(body)
    }
  }