mirror of
https://github.com/corda/corda.git
synced 2024-12-24 07:06:44 +00:00
Fixed IRS demo success case for PUT requests.
This commit is contained in:
parent
146f274dd0
commit
2b64ba1cc6
@ -22,6 +22,7 @@ import com.r3corda.demos.protocols.UpdateBusinessDayProtocol
|
|||||||
import com.r3corda.node.internal.AbstractNode
|
import com.r3corda.node.internal.AbstractNode
|
||||||
import com.r3corda.node.internal.testing.MockNetwork
|
import com.r3corda.node.internal.testing.MockNetwork
|
||||||
import com.r3corda.node.services.network.InMemoryMessagingNetwork
|
import com.r3corda.node.services.network.InMemoryMessagingNetwork
|
||||||
|
import com.r3corda.node.services.transactions.SimpleNotaryService
|
||||||
import joptsimple.OptionParser
|
import joptsimple.OptionParser
|
||||||
import joptsimple.OptionSet
|
import joptsimple.OptionSet
|
||||||
import joptsimple.OptionSpec
|
import joptsimple.OptionSpec
|
||||||
@ -284,11 +285,13 @@ private fun sendJson(url: URL, data: String, method: String) : Boolean {
|
|||||||
outStream.writeBytes(data)
|
outStream.writeBytes(data)
|
||||||
outStream.close()
|
outStream.close()
|
||||||
|
|
||||||
if (connection.responseCode == 201) {
|
return when(connection.responseCode) {
|
||||||
return true
|
200 -> true
|
||||||
} else {
|
201 -> false
|
||||||
println("Failed to " + method + " data. Status Code: " + connection.responseCode + ". Mesage: " + connection.responseMessage)
|
else -> {
|
||||||
return false
|
println("Failed to " + method + " data. Status Code: " + connection.responseCode + ". Mesage: " + connection.responseMessage)
|
||||||
|
false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user