0

I have a vb.NET App that uses System.Net.WebClient to query an API. I'm able to get the information I'm requesting just fine.

The people that supply the API are requesting that I

"set a custom User header when requesting data to determine the source application."

Am I supposed to pre-send something first, or append something to the url for the WebClient to processes? The API only accepts get requests and it doesn't have a parameter for an identification.

I'm stuck in terminology here. A search for that phrase, here, came up with server-side topics so I don't know what to look for. Can someone translate?

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
Skwiggs
  • 47
  • 7
  • possible duplicate of [Setting the User-Agent header for a WebClient request](http://stackoverflow.com/questions/11841540/setting-the-user-agent-header-for-a-webclient-request) – Jonathon Reinhart May 24 '14 at 03:20
  • They are asking you to include a `User-Agent:` header in your requests. Googling for ["webclient user agent"](http://www.google.com/search?q=webclient+user+agent) was enough to take me right to that question I've marked as duplicate. – Jonathon Reinhart May 24 '14 at 03:20
  • yeah don't know how to put a header in a url. But it sounds like your saying, just append a &User-Agent:MyAppName to the end of the URL? I'm going to look at the possible duplicate now. – Skwiggs May 24 '14 at 03:24
  • okay that gave me the syntax I needed to sort this out. Thanks – Skwiggs May 24 '14 at 03:26
  • You should take this opportunity to get familiar with what an [HTTP Request/Response session](http://doc.bonfire-project.eu/R1/api/example-session.html) looks like. Then you'll know what I mean by "request header". That way you understand what that code *actually does*. – Jonathon Reinhart May 24 '14 at 03:26
  • TYVM for the link. Yes I'm absolutely ready to learn it, just was having trouble finding what to look for. Thanks again. – Skwiggs May 24 '14 at 03:33

0 Answers0