Wednesday, 25 April 2018

POST data to any endpoint via REST API




curl -v -X POST -u "user:password" --header "Content-Type: application/json" 'http://<host>:<port>/<endpoint>' -d @test.json


You can change the Content-Type based on your required type and supported by endpoint.

Type application 
================
application/javascript
application/octet-stream
application/ogg
application/pdf
application/xhtml+xml
application/x-shockwave-flash
application/json
application/ld+json
application/xml
application/zip

Type Audio
==========

audio/mpeg
audio/x-ms-wma
audio/vnd.rn-realaudio
audio/x-wav

Type image
==========

image/gif
image/jpeg
image/png
image/tiff
image/vnd.microsoft.icon
image/x-icon
image/vnd.djvu
image/svg+xml

No comments:

Post a Comment

Thank You for your valuable comment

Difference between class level and object locking and static object lock

1) Class level locking will lock entire class, so no other thread can access any of other synchronized blocks. 2) Object locking will lo...