Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
MidTerm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
9731301
MidTerm
Commits
e891b2da
Commit
e891b2da
authored
4 years ago
by
9731301
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some changes
parent
fb2d11ec
master
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
37 deletions
+33
-37
workspace.xml
.idea/workspace.xml
+16
-29
Insomnia.java
src/com/insomnia/parser/Insomnia.java
+10
-0
Parser.java
src/com/insomnia/parser/Parser.java
+1
-1
RequestData.java
src/com/insomnia/parser/RequestData.java
+2
-3
RequestLoader.java
src/com/insomnia/parser/RequestLoader.java
+3
-3
ResponseData.java
src/com/insomnia/parser/ResponseData.java
+1
-1
No files found.
.idea/workspace.xml
View file @
e891b2da
...
...
@@ -7,25 +7,9 @@
</component>
<component
name=
"ChangeListManager"
>
<list
default=
"true"
id=
"f2dd20fb-7e97-49ef-9dfe-5631626d7912"
name=
"Default Changelist"
comment=
""
>
<change
afterPath=
"$PROJECT_DIR$/Requests/test2.insomnia"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/.idea/workspace.xml"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/.idea/workspace.xml"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$1.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$1.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$10.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$10.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$11.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$11.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$12.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$12.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$13.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$13.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$2.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$2.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$3.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$3.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$4.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$4.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$5.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$5.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$6.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$6.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$7.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$7.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$8.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$8.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$9.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel$9.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/GUI/RequestPanel.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/parser/RequestData.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/parser/RequestData.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/parser/RequestLoader.class"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/out/production/Insomnia/com/insomnia/parser/RequestLoader.class"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/insomnia/GUI/RequestPanel.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/insomnia/GUI/RequestPanel.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/insomnia/parser/Insomnia.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/insomnia/parser/Insomnia.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/insomnia/parser/Parser.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/insomnia/parser/Parser.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/insomnia/parser/RequestData.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/insomnia/parser/RequestData.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/insomnia/parser/RequestLoader.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/insomnia/parser/RequestLoader.java"
afterDir=
"false"
/>
<change
beforePath=
"$PROJECT_DIR$/src/com/insomnia/parser/ResponseData.java"
beforeDir=
"false"
afterPath=
"$PROJECT_DIR$/src/com/insomnia/parser/ResponseData.java"
afterDir=
"false"
/>
...
...
@@ -166,7 +150,10 @@
<workItem
from=
"1591024948574"
duration=
"21598000"
/>
<workItem
from=
"1591127468443"
duration=
"7941000"
/>
<workItem
from=
"1591179932347"
duration=
"2513000"
/>
<workItem
from=
"1591205535989"
duration=
"7908000"
/>
<workItem
from=
"1591205535989"
duration=
"8740000"
/>
<workItem
from=
"1591376356200"
duration=
"7395000"
/>
<workItem
from=
"1591474740815"
duration=
"314000"
/>
<workItem
from=
"1591548369519"
duration=
"737000"
/>
</task>
<servers
/>
</component>
...
...
@@ -201,30 +188,30 @@
<screen
x=
"0"
y=
"0"
width=
"1536"
height=
"824"
/>
</state>
<state
x=
"402"
y=
"167"
key=
"FileChooserDialogImpl/0.0.1536.824@0.0.1536.824"
timestamp=
"1590494460700"
/>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.bottom"
timestamp=
"159121
3140323
"
>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.bottom"
timestamp=
"159121
6845298
"
>
<screen
x=
"0"
y=
"0"
width=
"1536"
height=
"824"
/>
</state>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824"
timestamp=
"159121
3140323
"
/>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.center"
timestamp=
"159121
3140322
"
>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824"
timestamp=
"159121
6845298
"
/>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.center"
timestamp=
"159121
6845298
"
>
<screen
x=
"0"
y=
"0"
width=
"1536"
height=
"824"
/>
</state>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824"
timestamp=
"159121
3140322
"
/>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.left"
timestamp=
"159121
3140322
"
>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824"
timestamp=
"159121
6845298
"
/>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.left"
timestamp=
"159121
6845298
"
>
<screen
x=
"0"
y=
"0"
width=
"1536"
height=
"824"
/>
</state>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824"
timestamp=
"159121
3140322
"
/>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.right"
timestamp=
"159121
3140323
"
>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824"
timestamp=
"159121
6845298
"
/>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.right"
timestamp=
"159121
6845298
"
>
<screen
x=
"0"
y=
"0"
width=
"1536"
height=
"824"
/>
</state>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824"
timestamp=
"159121
3140323
"
/>
<state
width=
"1493"
height=
"154"
key=
"GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824"
timestamp=
"159121
6845298
"
/>
<state
x=
"249"
y=
"0"
key=
"SettingsEditor"
timestamp=
"1590962002174"
>
<screen
x=
"0"
y=
"0"
width=
"1536"
height=
"824"
/>
</state>
<state
x=
"249"
y=
"0"
key=
"SettingsEditor/0.0.1536.824@0.0.1536.824"
timestamp=
"1590962002174"
/>
<state
x=
"425"
y=
"237"
key=
"com.intellij.ide.util.TipDialog"
timestamp=
"1591
205543692
"
>
<state
x=
"425"
y=
"237"
key=
"com.intellij.ide.util.TipDialog"
timestamp=
"1591
548525191
"
>
<screen
x=
"0"
y=
"0"
width=
"1536"
height=
"824"
/>
</state>
<state
x=
"425"
y=
"237"
key=
"com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824"
timestamp=
"1591
205543692
"
/>
<state
x=
"425"
y=
"237"
key=
"com.intellij.ide.util.TipDialog/0.0.1536.824@0.0.1536.824"
timestamp=
"1591
548525191
"
/>
<state
x=
"499"
y=
"179"
key=
"extract.method.dialog"
timestamp=
"1590145349556"
>
<screen
x=
"0"
y=
"0"
width=
"1536"
height=
"824"
/>
</state>
...
...
This diff is collapsed.
Click to expand it.
src/com/insomnia/parser/Insomnia.java
View file @
e891b2da
...
...
@@ -3,6 +3,16 @@ package com.insomnia.parser;
public
class
Insomnia
{
public
static
void
main
(
String
[]
args
)
{
for
(
String
arg
:
args
){
if
(
arg
.
replace
(
"-"
,
""
).
trim
().
toLowerCase
().
equals
(
"help"
)){
System
.
out
.
println
(
"Insomnia Commands : "
);
System
.
out
.
println
(
"-url : enter url"
);
System
.
out
.
println
(
"--Method : set request method (GET,POST,PUT,DELETE)"
);
return
;
}
}
ResponseData
data
=
RequestLoader
.
run
(
Parser
.
parse
(
args
));
if
(
data
.
hasSyntaxError
()){
...
...
This diff is collapsed.
Click to expand it.
src/com/insomnia/parser/Parser.java
View file @
e891b2da
...
...
@@ -108,7 +108,7 @@ public class Parser {
return
v
.
toUpperCase
().
trim
();
default
:
return
RequestData
.
GET
;
return
"GET"
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/com/insomnia/parser/RequestData.java
View file @
e891b2da
...
...
@@ -10,10 +10,9 @@ import java.util.HashMap;
public
class
RequestData
implements
Serializable
{
private
String
name
=
""
;
//methods requests
public
static
String
GET
=
"GET"
,
POST
=
"POST"
,
DELETE
=
"DELETE"
,
PUT
=
"PUT"
;
//address of request
private
String
url
=
""
,
method
=
GET
;
private
String
url
=
""
,
method
=
"GET"
;
private
boolean
followRedirects
=
false
;
private
HashMap
<
String
,
String
>
headers
=
null
;
...
...
This diff is collapsed.
Click to expand it.
src/com/insomnia/parser/RequestLoader.java
View file @
e891b2da
...
...
@@ -35,7 +35,7 @@ public class RequestLoader {
try
{
String
mUrl
=
data
.
getUrl
();
if
(
data
.
getMethod
().
equals
(
RequestData
.
GET
))
{
if
(
data
.
getMethod
().
equals
(
"GET"
))
{
if
(
mUrl
.
contains
(
"?"
))
{
mUrl
=
mUrl
+
"&"
+
data
.
getBody
();
}
else
{
...
...
@@ -47,12 +47,12 @@ public class RequestLoader {
HttpURLConnection
con
=
(
HttpURLConnection
)
url
.
openConnection
();
con
.
setUseCaches
(
false
);
if
(!
data
.
getMethod
().
equals
(
RequestData
.
GET
)
&&
(!
data
.
getBody
().
isEmpty
()||!
data
.
getUploadPath
().
isEmpty
())
){
if
(!
data
.
getMethod
().
equals
(
"GET"
)
&&
(!
data
.
getBody
().
isEmpty
()||!
data
.
getUploadPath
().
isEmpty
())
){
con
.
setDoOutput
(
true
);
}
con
.
setDoInput
(
true
);
con
.
setInstanceFollowRedirects
(
data
.
isFollowRedirects
());
con
.
setInstanceFollowRedirects
(
data
.
isFollowRedirects
());
//change direction
con
.
setRequestMethod
(
data
.
getMethod
());
String
content_type
=
""
;
...
...
This diff is collapsed.
Click to expand it.
src/com/insomnia/parser/ResponseData.java
View file @
e891b2da
/**
* ResponseData represents a class
* ResponseData represents a class
that contains responses data and has some methods to keep these information
*/
package
com
.
insomnia
.
parser
;
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment