Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Convert web request to HTTPwebRequest

Posted on 2013-01-05
3
Medium Priority
?
437 Views
Last Modified: 2013-01-23
Hi,

I have a web request that I need to convert to .net the web request is currently  made via java script and is working successfully the following  is taken from chrome developers tools with the database id changed do you now how to convert it.

Request URL:https://api.tiggzi.com/rest/1/db/collections/jobs?where=%7B%22account%22%3A%22systems%22%2C+%22driver%22%3A%22JOE%22%2C+%22complete%22%3A%22false%22%7D/
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:application/json, text/javascript, */*; q=0.01
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Connection:keep-alive
DNT:1
Host:api.tiggzi.com
Origin:http://project.tiggzi.com
Referer:http://project.tiggzi.com/view/7cf54281-5407-XXXXXXX-783958ec1f0e/joblist.html
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11
X-Tiggzi-Database-Id:57786655XXXXXXXX
Query String Parametersview URL encoded
where:{"account":"systems", "driver":"JOE", "complete":"false"}
Response Headersview source
Access-Control-Allow-Origin:http://project.tiggzi.com
Connection:keep-alive
Content-Type:application/json
Date:Sat, 05 Jan 2013 15:16:42 GMT
Server:nginx
Set-Cookie:JSESSIONID=gKHfYmM8UlgomPJfgpiIreIB.undefined; Path=/; Secure
Transfer-Encoding:chunked
0
Comment
Question by:JoeBo747
3 Comments
 
LVL 16

Assisted Solution

by:Easwaran Paramasivam
Easwaran Paramasivam earned 1000 total points
ID: 38747258
0
 
LVL 42

Accepted Solution

by:
Meir Rivkin earned 1000 total points
ID: 38748401
since request method is GET u need to concatenate the parameters into the url string using
 '?' and '&' chars.

follow this post here:
http://stackoverflow.com/questions/3279888/how-to-add-parameters-into-a-webrequest                

make sure to pass the right request info to the suggested function and concatenate the parameters as explained.

so u ended up having the following url:

:https://api.tiggzi.com/rest/1/db/collections/jobs?account=systems&driver=JOE&complete=false

for the DB id you can add it at the end of the url in the same manner.
0
 
LVL 1

Author Closing Comment

by:JoeBo747
ID: 38811286
Sorry it has taken a while to get back to this, both your replies help in getting the correct method so only fair to share the points.
Thanks,
Joe
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

575 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question