Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
notes-app
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Abhay Menon
notes-app
Commits
d3c96b19
Commit
d3c96b19
authored
1 year ago
by
thaihoangdang
Browse files
Options
Downloads
Patches
Plain Diff
Done with PUT
parent
39eb96e1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!22
Http request
Pipeline
#89246
failed
1 year ago
Stage: build
Stage: test
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utilities/src/main/kotlin/notes/multi/utilities/HttpOperations.kt
+4
-1
4 additions, 1 deletion
...s/src/main/kotlin/notes/multi/utilities/HttpOperations.kt
with
4 additions
and
1 deletion
utilities/src/main/kotlin/notes/multi/utilities/HttpOperations.kt
+
4
−
1
View file @
d3c96b19
package
notes.multi.utilities
import
com.beust.klaxon.Klaxon
import
com.beust.klaxon.json
import
java.net.URI
import
java.net.URL
import
java.net.http.HttpClient
...
...
@@ -39,9 +40,11 @@ class HttpOperations {
val
tempNote
=
RemoteNote
(
note
.
id
,
note
.
title
,
note
.
text
.
toString
(),
note
.
dateCreated
,
note
.
lastModified
)
val
jsonNote
=
Klaxon
().
toJsonString
(
tempNote
)
println
(
jsonNote
)
val
client
=
HttpClient
.
newBuilder
().
build
()
val
request
=
HttpRequest
.
newBuilder
()
.
uri
(
URI
.
create
(
"http://localhost:8080/notes/"
))
.
uri
(
URI
.
create
(
"http://localhost:8080/notes/
${tempNote.id}
"
))
.
header
(
"Content-Type"
,
"application/json"
)
.
PUT
(
HttpRequest
.
BodyPublishers
.
ofString
(
jsonNote
))
.
build
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment